Fs2 open on Linux/Compiling
« Optimization | The fs2_open on Linux Guide Compiling |
Compile Script » |
Compiling The Source Code
The source code can now be compiled to a desired binary. This binary can be in 3 variants:
- Release - Good for playing the game normally
- FastDebug - Used to find errors during gameplay (Used for mod level debugging)
- Debug - Used to find errors on a code level. Please check this if the user wants to develop and debug the code further
For New Users - Compile Using Visual Studio Code
To compile the code in Visual Studio Code, the user must first set the desired build variant. To select this, the user must:
- Open the Command Palette (CTRL + SHIFT + P)
- Search or Type CMake: Select Variant
- Select the desired variant
-
Build the code by using any of the following methods:
- Open Command Palette and type CMake: Build
- Press the Build button
The Build Artifacts
The build artifacts should be inside the build directory. The full path of the binary must be:
${workspaceFolder}/build/bin/fs2_open_<version>_<instruction_set>-<variant>
The version will be the version of the source code.
Instruction Set will denote which type of CPU SIMD instructions are executed, SSE2 or AVX.
Variant will be the type of variant that the user selected earlier.
For eg. File name for the version 24.2.0, instruction set of AVX and of debug variant will be
fs2_open_24_2_0_AVX-debug
If you see the build in the build directory, congratulations! The binary is ready to be used to play and debug!
Run from within your fs2_open directory:
$ make
Sit back and enjoy gcc work its magic.
You will find the binary executable in code/ as either fs2_open_r if you built a release build or fs2_open_d if you built a debug build.
NOTE: in 3.6.15 and higher, quiet compiles are turned on by default. To get a verbose compile:
$ V=1 make
Also, the binary executable in code/ is now called fs2_open_3.6.15 and fs2_open_3.6.15_DEBUG