This guide walks you through everything needed to build the server and the GUI from a clean machine.
| Tool | Minimum version | Purpose |
|---|---|---|
| CMake | 3.25 | Build configuration |
| Ninja | any | Build generator (used by the Makefile) |
| Clang or GCC | C++20 support | Compiler |
| vcpkg | latest | Third-party dependencies (GUI only) |
| ccache | any (optional) | Speeds up rebuilds, auto-detected |
| Criterion | 2.x (optional) | Server & GUI unit tests (pkg-config) |
| Python | 3.10+ (optional) | Server & AI test suites (auto venv) |
The GUI links against system graphics libraries that are not managed by vcpkg:
- Linux: OpenGL and X11 development headers
# Debian / Ubuntu sudo apt install libgl1-mesa-dev libx11-dev # Fedora sudo dnf install mesa-libGL-devel libX11-devel # Arch sudo pacman -S mesa libx11
- macOS: Cocoa and OpenGL frameworks, provided by the Xcode Command Line
Tools:
xcode-select --install
The server has no third-party dependencies — only the C++ standard library and POSIX sockets.
The GUI depends on two header-only libraries fetched and built through vcpkg:
stb— image loading (stb_image.h) and font rasterization (stb_truetype.h)miniaudio— audio playback
⚠️ Important: thevcpkgpackage from Homebrew/apt only installs thevcpkgbinary, not the ports tree or the CMake toolchain file (scripts/buildsystems/vcpkg.cmake). You need a full git clone.
-
Clone the vcpkg repository (anywhere on your machine — your home directory is a good default):
git clone https://github.com/microsoft/vcpkg.git ~/vcpkg -
Bootstrap it:
~/vcpkg/bootstrap-vcpkg.sh -disableMetrics -
Export
VCPKG_ROOTso the project'sMakefilecan locate the vcpkg toolchain file. Add this line to your shell profile (~/.zshrc,~/.bashrc,~/.profile, ...):export VCPKG_ROOT="$HOME/vcpkg"
-
Reload your shell:
source ~/.zshrc # or open a new terminal
That's it — stb and miniaudio are declared in gui/vcpkg.json
and will be downloaded and compiled automatically by CMake on the first build.
Once VCPKG_ROOT is exported:
make # build server + GUI (Release)
make debug # build server + GUI (Debug, -O0 -g -DDEBUG_MODE)
make zappy_server # build only the server
make zappy_gui # build only the GUIThe resulting binaries zappy_server and zappy_gui are copied to the
repository root.
make format # run clang-format on server/src and gui/src
make clean # remove the build directories
make fclean # clean + remove the zappy_server / zappy_gui / zappy_ai binaries
make re # fclean + all (full rebuild)
make tests_run # run the server, AI and GUI test suites (see TESTING.md)A flake.nix is provided with the required build tools
(clang, cmake, ninja, pkg-config):
nix developYou still need to set up VCPKG_ROOT as described above — Nix does not
provide vcpkg.
Error: VCPKG_ROOT is not set. Install vcpkg and export VCPKG_ROOT=/path/to/vcpkg
You either haven't exported VCPKG_ROOT, or you're using a shell that
doesn't source the profile where it's defined. Verify with:
echo $VCPKG_ROOT
ls $VCPKG_ROOT/scripts/buildsystems/vcpkg.cmakeIf the second command fails, your VCPKG_ROOT points to an incomplete
install (e.g. the Homebrew binary-only package) — re-clone the full repo as
described above.
Install the development packages listed in Platform-specific system libraries.
The first configure step downloads and builds stb and miniaudio through
vcpkg. Subsequent builds reuse vcpkg's binary cache and are fast.