Skip to content

Compiling RITEG.V2

Requirements (to compile)

  • Be able to work in a terminal
  • GNU bash (might use Git bash on Windows systems, alternatively use Cygwin)
  • CMake version 3.25 or newer for the presets (3.15 is the minimum for a plain configure)
  • Ninja (recommended; only the Ninja and Makefile generators write compile_commands.json for clangd)
  • An ISO C99 compiler
  • An ISO C++20 compiler

Requirements (to run)

  • Be able to work in a terminal
  • A GPU that can comprehend OpenGL 3.3

The easy way

  • To build a 64-bit Windows binary, run the build-win64.bat script;
  • To build a 32-bit Windows binary, run the build-win32.bat script;
  • To build a generic UNIX binary, run the build-unix.sh script;

Presets

CMakePresets.json defines two presets, common-debug and common-release. They configure into build/<preset>/ and leave the generator to CMake, so Ninja is used wherever it is available. The presets also make the build export compile_commands.json, which is what the editor environments consume:

cmake --preset common-debug
cmake --build --preset common-debug
cmake --preset common-release
cmake --build --preset common-release

cmake --list-presets prints the ones the current CMake sees.

The hard way

cmake -B build -A x64 -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release --parallel