Skip to main content

Build

Windows (MSVC + vcpkg)

cmake -S . -B build_jobs_msvc -G "Visual Studio 17 2022" -A x64 `
"-DCMAKE_TOOLCHAIN_FILE=<VCPKG_INSTALL_DIR>/scripts/buildsystems/vcpkg.cmake" `
-DPROJECT_ENABLE_UNITTEST=YES -DPROJECT_ENABLE_SAMPLE=YES
cmake --build build_jobs_msvc --config Debug

If you want to work with clangd, it is recommended to switch to the Ninja generator to produce compile_commands.json, and keep the directory consistent with .vscode/settings.json (build_jobs_cmake_tools):

cmake -S . -B build_jobs_cmake_tools -G Ninja `
"-DCMAKE_TOOLCHAIN_FILE=<VCPKG_INSTALL_DIR>/scripts/buildsystems/vcpkg.cmake" `
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=20 -DPROJECT_ENABLE_UNITTEST=YES

Linux / macOS

# Auto-detect and configure (creates build_jobs_$(uname -s))
bash cmake_dev.sh -lus -- -DCRYPTO_USE_OPENSSL=YES

cd build_jobs_*
cmake --build . -- -j4

You can also run cmake -S . -B <BUILD_DIR> [options...] manually and use your own prebuilt dependency libraries.

Key CMake Options

OptionDefaultDescription
PROJECT_ENABLE_SAMPLEOFFBuild samples
PROJECT_ENABLE_UNITTESTOFFBuild unit tests
PROJECT_ENABLE_PRECOMPILE_HEADERSONPrecompiled headers
PROJECT_ENABLE_UNITY_BUILDOFFUnity build (recommended OFF for local development + clangd)
ATFRAMEWORK_USE_DYNAMIC_LIBRARYON by default on LinuxBuild as dynamic libraries
PROJECT_SERVER_FRAME_USE_STD_COROUTINEON after detectionUse C++20 coroutines (otherwise libcopp cotask)
PROJECT_SERVER_FRAME_ENABLE_RPC_MOCKON in DebugRPC mock
PROJECT_SANTIZER_USE_ADDRESS/THREAD/...OFFSanitizers
CRYPTO_USE_OPENSSL / CRYPTO_USE_MBEDTLSCrypto backend

All services (echosvr / cachesvr / authsvr / lobbysvr / rank_settlement_svr / orbitsvr / component services / tools) are built unconditionally in src/CMakeLists.txt; there are no per-service switches.

After the build completes, executables and runtime resources are located in <BUILD_DIR>/publish/.

Incremental Build Conventions

Code and resources consumed by CMake targets must keep their timestamps when content is unchanged: do not unconditionally touch files or overwrite them with identical content. Generation rules should use accurate OUTPUT/BYPRODUCTS/DEPENDS/DEPFILE; for content-stable publishing use configure_file or cmake -E copy_if_different.