Add Windows build instructions with MSYS2
Visual Studio always gave me trouble and I didn't feel like installing 8GB of Clang-related tools, I looked for alternatives and the MSYS2 solution seems to be a pretty quick and easy compromise to give people an environment with Clang.
As described
- ✔️ Installed msys2 from Scoop
- ✔️ Ran the
msys2shell - ✔️ ran
pacman -Syuto update the package index - ✔️ ran
pacman -S mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-libc++ mingw-w64-x86_64-ninja - ❌ ran
cmake -DCMAKE_BUILD_TYPE=Debug .-
bash: cmake: command not found
-
Alternative approach
I also tried normal cmake with these, instead of the one from the super long package name. It runs but doesn't detect a compiler unless you install normal clang as well.
And I also installed normal ninja and make to solve the other issues that came up before CMake would actually generate the Makefile.
So I tried again after running pacman -S cmake ninja clang make to solve all of the initial problems, now it fails again while compiling.
Errors
xbox.h:248:26: error: member ‘be<unsigned int> _XXOVERLAPPED::<unnamed union>::<unnamed struct>::Error’ with constructor not allowed in anonymous aggregate
xbox.h:249:26: error: member ‘be<unsigned int> _XXOVERLAPPED::<unnamed union>::<unnamed struct>::Length’ with constructor not allowed in anonymous aggregate
As described
✔️ Installed msys2 from Scoop
✔️ Ran the
msys2shell✔️ ran
pacman -Syuto update the package index✔️ ran
pacman -S mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-libc++ mingw-w64-x86_64-ninja❌ ran
cmake -DCMAKE_BUILD_TYPE=Debug .
bash: cmake: command not foundAlternative approach
I also tried normal
cmakewith these, instead of the one from the super long package name. It runs but doesn't detect a compiler unless you install normalclangas well. And I also installed normalninjaandmaketo solve the other issues that came up before CMake would actually generate the Makefile.So I tried again after running
pacman -S cmake ninja clang maketo solve all of the initial problems, now it fails again while compiling.Errors
I don't know how the Scoop version of MSYS2 works, but if you install it with the installer from the website, you should have multiple available environments, with only two of them being CLANG
If you launched your MSYS2 in the right environment, the name should appear next to the current directory path. The path in which your packages go depend on the environment, so it would explain why yours didn't locate cmake at first.
I reinstalled Msys2 from the website instead of Scoop on the slightest chance that there's a functional difference between that and the Scoop version. This is becoming an extremely costly experience data-wise, as I've tried every configuration I can think of and have redownloaded these multi-gigabyte toolchains many times.
Now we're just back to not being able to find a compiler. It's like this "CLANG environment" doesn't even come with CLANG!
After I installed that it finally works.
HALLELUJAH!
So add this package to your instructions: mingw-w64-clang-x86_64-clang
& Ninja (cmake --build not work)
Followed this chain to the letter. Doesn't appear to work. Still get configuring incomplete.
Edit: Fixed it. Should specify to clone w/ --recursive