Skip to content
marcushutchings edited this page Oct 8, 2022 · 53 revisions

Clone

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

MSVC - x64

git clone https://github.com/beyond-all-reason/vclibs64 vclibs64

MSVC - x32

git clone https://github.com/spring/vclibs14 vclibs

  • Dont change path name of vclibs64/vclibs or cmake won´t find the libs

Dependencies

  • 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.4) Link to 3.16.8 https://github.com/Kitware/CMake/releases/tag/v3.16.8
  • Tested with 3.16.8 from https://cmake.org/files/v3.16/
  • Cmake 3.24.2 tested to work after 2022.09.15 resolving an ASM_MASM error in cmake project generation.
  • As a result of the ASM_MASM error, CMake versions 3.17 through to (and including) 3.23 probably won't work.

Env variables

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

Building

  • 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