- Environment: All builds must be performed on a Linux system.
- Code Style: All commits must strictly adhere to the project's
clang-formatconfiguration.
To enable incremental, cached builds and reduce compilation time, ccache is required.
-
Install: Ensure
ccacheis installed on Linux.- Example:
sudo apt-get install -y ccache
- Example:
-
CMake Configuration: The initial
cmakecommand must use the Debug build type and include the ccache launcher flags:cmake -B build/ \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ ... [Other flags from BUILD.md]
We use clang-format-18 via Docker to ensure style consistency. Use the following command to automatically format your code.
-
Directory: Navigate to the Git root directory.
-
Execution: Run this command to perform an in-place edit to all source files with the required style:
docker run --rm --platform linux/amd64 \ -v "$(pwd):$(pwd)" -w "$(pwd)" \ ghcr.io/jidicula/clang-format:18 \ -i --Werror --style=file \ $(find src tests -iname '*.h' -o -iname '*.c' -o -iname '*.cpp' -o -iname '*.hpp')