XenonRecomp icon indicating copy to clipboard operation
XenonRecomp copied to clipboard

Add Windows build instructions with MSYS2

Open Sakimotor opened this issue 11 months ago • 5 comments

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.

Sakimotor avatar Mar 03 '25 08:03 Sakimotor

As described

  • ✔️ Installed msys2 from Scoop
  • ✔️ Ran the msys2 shell
  • ✔️ ran pacman -Syu to 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

halotroop2288 avatar Mar 03 '25 10:03 halotroop2288

As described

  • ✔️ Installed msys2 from Scoop

  • ✔️ Ran the msys2 shell

  • ✔️ ran pacman -Syu to 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

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

image

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.

image

Sakimotor avatar Mar 03 '25 11:03 Sakimotor

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! image

After I installed that it finally works.

HALLELUJAH!

image

So add this package to your instructions: mingw-w64-clang-x86_64-clang

halotroop2288 avatar Mar 03 '25 22:03 halotroop2288

& Ninja (cmake --build not work) image

ImanCol avatar Mar 12 '25 17:03 ImanCol

Followed this chain to the letter. Doesn't appear to work. Still get configuring incomplete.

Edit: Fixed it. Should specify to clone w/ --recursive

Oroborius avatar Mar 14 '25 07:03 Oroborius