- CMake 3.31+
- C++23 compatible compiler:
- GCC 13+ (Linux)
- Clang 16+ (macOS)
- MSVC 2022+ (Windows)
Clone the repository:
git clone --recursive https://github.com/wermos/ScyllaChess.git
cd ScyllaChessNote: The --recursive flag is essential as the project uses git submodules (libassert and Catch2).
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target allThe project provides several build targets for different needs:
cmake --build build --target libraryBuilds only the scylla_engine library.
cmake --build build --target engineBuilds the library and main executable. Run with:
./build/scyllacmake --build build --target testscmake --build build --target all# Configure with testing enabled
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON
# Build all targets including tests
cmake --build build --target all
# Run tests using CTest
ctest --test-dir build --output-on-failureOr run tests using CMake's test target
cmake --build build --target test# Run tests matching a pattern
ctest --test-dir build -R "test_name_pattern" --output-on-failure
# Run the test executable directly
./build/tests/testsThis project uses pre-commit hooks to ensure code quality and consistent formatting.
Install pre-commit:
pip install pre-commitInstall the hooks:
pre-commit install --hook-type pre-commit
pre-commit install --hook-type pre-pushInstall required tools for C++ formatting
sudo apt-get install clang-format # Ubuntu/Debian
brew install clang-format # macOSand CMake formatting
pip install cmake-formatCode is automatically formatted when you git commit. Additional checks run when you git push.
#Format all files
pre-commit run --all-files
# Format only staged files
pre-commit run
# Run specific hooks
pre-commit run clang-format --all-filesYou can skip hooks by using:
git commit --no-verify # Skip pre-commit hooks
git push --no-verify # Skip pre-push hooksBut this is not recommended.
Formatting is done using clang-format. We follow Google's coding style with one modification: we use 4-space indents instead of 4-space indents.
CMake is formatted using cmake-format.
- Class names use
PascalCase. - Functions and variable names use
snake_case. - Member variables use
m_snake_case.
-
Fork and clone the repository with submodules.
-
Set up pre-commit hooks (see Development Setup)
-
Create a feature branch:
git checkout -b feature/amazing-feature -
Make your changes and ensure tests pass
-
Push and create a pull request
# Check formatting
pre-commit run --all-files
# Build like CI
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target engine
# Test like CI
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON
cmake --build build --target all
cmake --build build --target test