Compile MuseScore with msvc / Visual Studio
As stated in https://musescore.org/en/node/106066, building MuseScore with Microsoft tools could be interesting. It could give us access to the new QWebEngine (since it's not supported by Qt for Mingw) and maybe give us some more debug tools and speed?
I open this issue to gather some knowledge about MuseScore and MSVC. Here are my notes so far.
- Deactivate most option (OMR, Jack, Portaudio etc...)
- In the CMakeLists.txt files, make sure to use WIN32 and MINGW when appropriate
- in all.h, #define WIN32_LEAN_AND_MEAN to avoid some name clashes with Windows headers
- Some options recognized by GCC and Clang are not recognized by MSVC (Wextra, Winvalidpch) and need to be changed
in zita, make float implicit using 2.0f notation
MuseScore uses GCC extension, Clang can cope with them, MSVC can't
- Variable Length Arrays ot VLAs, very convenient... I don't think we want to stop using this. Any solution to keep this syntax but make it work with msvc?
- switch, case on a range, easy to workaround, make the code a bit more verbose but workable
MSVC doesn't recognize alternative operators "or". || must be used...
We can use Q_CC_MSVC to write specific code for MSVC
- Sleep is not defined with MSCV, but sleep (lower case s) is.
- dependencies directory contains the dependencies from the zip used for mingw