This adds the following:
* A `compile_commands` target for the ninja_build.sh script.
This generates a `compile_commands.json` file, which is used
by tools such as clangd, in a new target directory called
`build.tooldata`. Unity builds must be disabled for the database
to be complete; see [this Discord comment by Casper Jeukendrup](https://discord.com/channels/818804595450445834/939880479887327302/1001483416753143818)
for more info.
* Additionally, a configuration file for clangd has been created
to tell it to find the file in the `build.tooldata` directory.
* Add a one-line change to the workspace settings for VSCode,
telling it where to find the Uncrustify config.
Add placeholder_translations.py script to generate fake translations.
Run the script on GitHub Actions to add the translations to nightly
and development builds.
Fake translations are displayed in the UI like this:
Source text: Choose instruments
Translation: ᵗʳ«Choose instruments»
This enables developers to see which strings have been correctly marked
for translation without having to wait for a proper translation to be
made available.
Special markup is used to identify plural translations:
Source text: %n measure(s)
Translation (1st plural form): ᵗʳ¹«%n measure(s)»
Translation (2nd plural form): ᵗʳ²«%n measure(s)»
Etc.
See the second page of the New Score dialog for an example of plurals.
Replacement markers %1, %2, etc. for QString arg() are also identified:
Source text: Add %1 to chord
Translation: ᵗʳ«Add ⌜%1⌝ to chord»
Arguments must be translated separately to the main string:
Non-translated argument: ᵗʳ«Add ⌜D⌝ to chord»
Translated argument: ᵗʳ«Add ⌜ᵗʳ«D»⌝ to chord»
The Python script could be modified to display more information in the
translated strings such as context, disambiguation, comments or file
name and line number of the string in the code or in the .ts file.
Fix#11060 by populating the Preferences > Shortcuts list from UiAction
definitions in the C++ code instead of from the shortcuts*.xml files.
Also makes shortcut context a property of the action rather than the
shortcut. This has the advantage that all actions are guaranteed to be
present in Preferences and the shortcut context is guaranteed to be the
same regardless of platform and keyboard layout.
The action name displayed in Preferences > Shortcuts is now based on
the action's description rather than its title. This is because titles
are used in menus so they must be as short as possible, but more
information is needed in Preferences. For example:
Title: "Composer" (used in menu Add > Text > Composer)
Description: "Add text: composer" (used in Preferences > Shortcuts)
Actions with no description will not be displayed in Preferences.
This commit changes algorithmic code and updates a few descriptions and
shortcut contexts that are not automatable. The remaining contexts and
descriptions will be updated by a script in the next commit.
Adds a cross-platform script that automates the process of creating a
build directory and compiling MuseScore. Run the script like this:
$ cmake -P build.cmake [args...]
This works in all shells on all platforms. Developers with a Unix-like
environment (including Git Bash on Windows) can also use:
$ ./build.cmake [args...]
Build step arguments:
clean Delete the build directory.
configure Create a build directory and run CMake inside it.
build Compile code using the native build tool.
install Copy compiled files to final destinations.
run Run the installed program.
Each step implies all previous steps except 'clean' and 'run', which
are only performed when explictly requested. If no steps are given then
the configure, build, and install steps are performed by default.
All other arguments are passed to CMake during configuration.
Example command:
$ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug
$ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F
This creates and installs a Debug build using the Ninja generator, and
then runs the compiled program with the -F option to perform a factory
reset, thereby ensuring it is in the initial state.
Overrides:
If you frequently need to build with non-default settings then you can
create a file build_overrides.cmake with all your personal settings to
avoid having to pass them in on the command line each time.
# build_overrides.cmake example file
set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64")
list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug)
This file is ignored by Git to prevent it being shared with other
developers, but you could always copy another file into its place
(e.g. during a CI build on GitHub Actions).
Update cmake files to support 64-bit compilation.
Add variables to easily switch between 32-bit and 64-bit compilation
Update msvc_build.bat to support both 32-bit and 64-bit compilation
Optimize msvc_build.bat to avoi excessive output
Update AppVeyor build scripts so that default compilation is 64-bit now
Make default configuration built from opening MuseScore directory 64-bit
RelWithDebInfo. All other configurations are up to msvc_build.bat
script.
Qt libs which are used for building are placed in msvc2017_64 folder.
These changes require new structure of the dependencies folder.
1) fix some bugs which appear in runtime: replace QString::tostdstring() to Foo.toUtf8().constData().
2) Enable start center online community. To use it you need download webengine in your QT lib. see instruction https://musescore.org/en/handbook/developers-handbook/compilation/compile-instructions-windows-visual-studio-2017-wip
3) update install steps. Add additional dlls for webEngine. Add copying dlls and musescore.exe to /msvc.install/bin folder. Run project will work with the "$(ProjectDir)\..\..\msvc.install\bin\MuseScore.exe" specified in Debugging field in mscore project
4) Moving AppVeyor from MinGW to MSVC. Exclude ALL MSVC project from INSTALL project. Exclude ALL from PACKAGE. Remove migw-cmake in script build, add .bat instead. Remove xcopy from 7z archive step
5) Fix warning : Warning C4703 potentially uninitialized local pointer variable '' used; Warning C4456 declaration of '' hides previous local declaration; Warning C4458 declaration of '' hides class member
6) Change path to 11 version wix toolset which created .msi installer package
In detail, changes are as follows:
- Changed .gitignore to ignore VS-specific files and directories.
- VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths.
- New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html
- Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled).
- all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC.
- Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always.
- The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC.
- Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of:
x Setting target properties for MSVC
x Using all.h in source dir
x Adding pre-compiled headers to target
x Removing dependency from mops1 and mops2
Notes:
- The INSTALL target has NOT BEEN UPDATED for MSVC.
Add mscore/revision.h to .gitignore, since it is a generated file.
Remove mscore/revision.h from the git index.
In Makefile, add "revision" as a dependency of "debug", as it
already is of "release".