-
Notifications
You must be signed in to change notification settings - Fork 105
Building on MSVC
git clone --recursive https://github.com/beyond-all-reason/spring -b BAR105 spring
If you cloned before without --recursive, you can apply --recursive with
cd spring
git submodule update --init --recursive
Once spring is cloned.
cd spring
(if not already in the spring directory)
git clone https://github.com/beyond-all-reason/vclibs64 vclibs64
- Dont change path name of vclibs64 or cmake won´t find the libs
- MSVC 2022 community edition, tested, works with almost no issues. Download and install here: https://visualstudio.microsoft.com/vs/community/
- CMake Any recent version should suffice, this one for example https://github.com/Kitware/CMake/releases/tag/v3.23.4
Env variables can be used to avoid copying potentially large maps and games folders into the same folder as the build products.
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
- Launch cmake with
cmake-gui .
choose MSVC 2022 / x64 - Set source code to the cloned spring repository.
- Pick the build dir separate from the main spring dir (for example
spring/build-msvc
) - In the options disable AI (
AI_TYPES = NONE
). - Ensure that
MINGWLIBS
points to the cloned vclibs64 repository (it should already be set correct if vclibs64 was cloned to spring). - Under Tools, press Configure, then press Generate.
- Go to the build directory and open the project file Spring.sln.
- Find engine-legacy in the the projects list and set it to be the Startup Project
- Build the project in MSVC
- 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)*
- If you did not set the SPRING_DATADIR and SPRING_WRITEDIR env variables, copy maps, games, base and fonts from an existing spring install into builddir.
- 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