DescentDevelopers / Descent3

Descent 3 by Outrage Entertainment
GNU General Public License v3.0
2.85k stars 244 forks source link

Create new 'win' preset for Ninja (native) builds #423

Closed tophyr closed 3 months ago

tophyr commented 4 months ago

Keep win32 and win64 using MSBuild; do not add build parallelism (it apparently causes races)

Pull Request Type

Description

Related Issues

Screenshots (if applicable)

Checklist

Additional Comments

tophyr commented 4 months ago

@Lgt2x for your consideration

CI config not yet updated

tophyr commented 4 months ago

ok, Windows-Ninja CI config added and passing

Lgt2x commented 4 months ago

Why would we keep msbuild? ninja seems better from every perspective

tophyr commented 4 months ago

@Lgt2x Ninja appears incapable of producing a 32-bit binary on a 64-bit build host (or a 64-bit binary on a 32-bit build host), is why

Lgt2x commented 3 months ago

@Lgt2x Ninja appears incapable of producing a 32-bit binary on a 64-bit build host (or a 64-bit binary on a 32-bit build host), is why

Actually you can. I figured out through #422 that when using the ninja generator, the only difference is that you need to load the compiler toolchain manually, whereas msbuild does it automatically when you provide the -A option or architecture Cmake preset parameter.

In order to load the toolchain, can either 1) Use the VS script that does it for you, that's what the CI build do under the hood with the msvc-dev-cmd action. or 2) Launch the x64/x86 command prompt for VS in the start menu, which prepares the MSVC toolchain for either 32bit or 64bit.

So to get the 32bit build on a 64bit computer: Launch x86 native command prompt, and run cmake --preset win32, and use x64 command prompt/preset to get the 64bit build

tophyr commented 3 months ago

Ah, much better then.