Skip to content

Compiling Vanilla Conquer

OmniBlade edited this page Aug 5, 2020 · 1 revision

Prerequisites

Vanilla-Conquer uses the popular CMake meta build system to generate build files for various different build engines ranging from command line systems such as make and ninja to IDE solutions for Visual Studio and XCode. To build Vanilla-Conquer you will first need to install CMake version 3.0 or later. On Linux you will probably be able to get a recent version from your distributions package manager. On Windows or macOS you can download it from here.

It is also recommended that you have git installed and use it to clone the repository. If CMake can find git on your system it will embed information relating to the commit you are building in the version information used in game. For Linux again the package manager should have it available. For macOS it is part of the XCode command line tools you can install by running xcode-select --install in terminal. For Windows you can download git from here.

Configuring and Compiling

Downloading the source

The recommended way of obtaining the source is to clone it from GitHub. If you just want to build Vanilla-Conquer and run it, you can clone directly from our main repo. If you are wanting to contribute then you should fork the repository and then clone from your fork so you can create pull requests against it. Cloning using the command line is fairly straight forward and can be done with a few simple steps. This example assumes a directory called projects on Windows at the root of the C: drive:

  • Open a command line terminal (git bash or cmd on Windows) and cd to the directory you will clone the respository to. cd C:\projects

  • Run git clone with the address of the repository from the "Clone or download" dropdown on the GitHub page. git clone https://github.com/Vanilla-Conquer/Vanilla-Conquer.git

Configuring the build

CMake is used to configure the build. From the command line you will need to create a build directory and then run CMake in it. The following examples assume you cloned into C:\projects on a Windows system.

  • cd to the cloned source directory. cd Vanilla-Conquer

  • Make a build directory. mkdir build

  • cd to the new directory. cd build

  • Run CMake with the desired generator using the -G command and setting the type of build. cmake -G"Visual Studio 16 2019" -DCMAKE_BUILD_TYPE="Release" ..

  • Run CMake with just the -G and no generator name to get a list of available generators for your platform. cmake -G

  • If you ommit the generator, you will get the default generator detected for your platform.

  • When building with Visual Studio, you will need to specify a 32bit build with -A win32

Build Vanilla-Conquer

At this point CMake will have generated build files for you and you can build by invoking cmake --build .. Alternatively you can run the platform specific command if you want to pass additional argument. The example above you will have a .sln that you can load into Visual Studio or build with msbuild from the command line. Building with the 'make' command is common on other platforms.