-
Notifications
You must be signed in to change notification settings - Fork 103
Building on MSVC
git clone --recursive https://github.com/beyond-all-reason/spring -b BAR105 spring
cd spring
If you cloned before without --recursive, you can apply --recursive with
git submodule update --init --recursive
git clone https://github.com/spring/vclibs64 vclibs64
git clone https://github.com/spring/vclibs14 vclibs
- Dont change path name of vclibs64/vclibs or cmake won´t find the libs
- MSVC 2019 community edition, tested, works with almost no issues (2022 is not good, as cmake cant generate project files for it, stick to 2019)
- CMake 3.16 (do not install versions newer than 3.16) Link to 3.16.0 https://github.com/Kitware/CMake/releases/tag/v3.16.0
- Tested with 3.16.8 from https://cmake.org/files/v3.16/
Add to permanent variables in Windows settings (or [advanced] use script to set them up each time the engine is launched)
set SPRING_DATADIR=<place to where your content root is>
set SPRING_WRITEDIR=<place to where your content root is>
E.g. your spring maps are at E:\spring\maps
, <place to where your content root is>
should be E:\spring
Note set
is only needed if you launch from script, Windows environment variables dialog needs no set
-
cmake-gui .
choose win32 or x64 depending on which vclibs you chose above -
Pick the build dir separate from the main spring dir (for example
spring/build-msvc-x32
) -
In the options disable sound (
NO_SOUND = ON
), disable AI (AI_TYPES = NONE
),BUILD_BITS = 32
(if it's 64 you likely didn't choose MSVC 2019 (x32) two steps above). -
Press Configure, Generate, Open Project
-
Apply hacks https://github.com/beyond-all-reason/spring/wiki/Common-MSVC-gotchas
-
Build engine-legacy from the projects list, set it startup default
-
Copy *.dll from vclibs14/dll into the builddir (Debug/Release/etc)
-
Copy unitsync.dll from somewhere or just create an empty file in the builddir (Debug/Release/etc)*
-
Launch the engine right from the debugger (MSVC environment variables (as set from the debugger menu) are broken, use some .bat script to set env variables (in case not set globally) and launch spring.exe