This guide covers everything required to compile OpenQ4 from source on Windows, Linux, and macOS.
Note
Regular players do not need to build from source. Download the latest release from the Releases page and follow the Installation instructions instead.
- Prerequisites
- GameLibs Companion Repository
- Build Setup
- Build Options
- Building on Windows
- Building on Linux / macOS
- Output Files
- Packaging a Distributable
| Platform | Minimum | Notes |
|---|---|---|
| Windows | MSVC 19.46+ (Visual Studio 2026+) | Use the Developer PowerShell or run tools/build/openq4_devcmd.cmd to initialise the environment |
| Linux | GCC 13+ or Clang 17+ | Distro packages are fine |
| macOS | Xcode 16+ / Clang 17+ | Install Command Line Tools via xcode-select --install |
- Meson 1.2.0 or newer
- Ninja (recommended backend)
- Python 3 (used by
tools/build/sync_icons.pyand the wrapper scripts)
On Windows, always invoke Meson through tools/build/meson_setup.ps1 rather than calling meson directly from an arbitrary shell. The wrapper ensures MSVC tools (cl.exe, link.exe, etc.) are on PATH and performs automatic icon-set synchronisation before setup, compile, and install steps.
# Open a regular PowerShell window and use the wrapper:
powershell -ExecutionPolicy Bypass -File tools/build/meson_setup.ps1 <meson-command> [args...]Alternatively, open tools/build/openq4_devcmd.cmd first to initialise the Visual Studio environment, then call meson directly.
OpenQ4's game code (single-player and multiplayer modules) lives in a separate companion repository — OpenQ4-GameLibs. This separation clearly identifies the SDK-licensed components derived from the Quake 4 SDK.
Important
The OpenQ4 build expects OpenQ4-GameLibs to be checked out alongside OpenQ4, at ../OpenQ4-GameLibs relative to this repository. If the companion repository is missing or at a different path, game-module builds will fail.
# Clone both repositories side-by-side:
git clone https://github.com/themuffinator/OpenQ4.git
git clone https://github.com/themuffinator/OpenQ4-GameLibs.git
# Result:
# ./OpenQ4/ ← this repository
# ./OpenQ4-GameLibs/ ← game library sourceTo use a custom location, set the environment variable before configuring:
export OPENQ4_GAMELIBS_REPO=/path/to/OpenQ4-GameLibs # Linux / macOS
$env:OPENQ4_GAMELIBS_REPO = "C:\path\to\OpenQ4-GameLibs" # PowerShellTo rebuild the game libraries as part of the OpenQ4 build, set OPENQ4_BUILD_GAMELIBS=1 before running compile.
All dependencies (SDL3, GLEW, OpenAL Soft, stb_vorbis) are managed as Meson subprojects — no manual dependency installation is required. The first configure step downloads and builds them automatically.
Pass any of these with -D<option>=<value> on the meson setup command line:
| Option | Default | Description |
|---|---|---|
build_engine |
true |
Build OpenQ4-client_<arch> and OpenQ4-ded_<arch> |
build_games |
true |
Build game modules |
build_game_sp |
true |
Build single-player game module |
build_game_mp |
true |
Build multiplayer game module |
platform_backend |
platform-dependent | sdl3 or legacy_win32 on Windows, sdl3 or native on Linux, native on macOS |
version_track |
dev |
Build track label (stable, dev, nightly, beta, rc) |
version_iteration |
(auto) | Dot-separated iteration counter for pre-release builds |
enforce_msvc_2026 |
false |
Enforce MSVC 2026+ requirement (Windows only) |
Note
Release packaging targets the static MSVC CRT so end users do not need a separate Visual C++ Redistributable install.
# 1. Configure
powershell -ExecutionPolicy Bypass -File tools/build/meson_setup.ps1 setup --wipe builddir . --backend ninja --buildtype=debug --wrap-mode=forcefallback
# 2. Compile
powershell -ExecutionPolicy Bypass -File tools/build/meson_setup.ps1 compile -C builddir
# 3. Run directly from builddir
builddir\OpenQ4-client_x64.exe# 1. Configure
powershell -ExecutionPolicy Bypass -File tools/build/meson_setup.ps1 setup builddir . --backend ninja --buildtype=release --wrap-mode=forcefallback
# 2. Compile
powershell -ExecutionPolicy Bypass -File tools/build/meson_setup.ps1 compile -C builddir
# 3. Stage distributable package into .install/
powershell -ExecutionPolicy Bypass -File tools/build/meson_setup.ps1 install -C builddir --no-rebuild --skip-subprojectsOnce the MSVC environment is initialised you can call meson directly:
meson setup builddir . --backend ninja --buildtype=release
meson compile -C builddirNote
As of March 30, 2026, Linux defaults to the SDL3 backend. -Dplatform_backend=native remains available as the fallback Linux path. On Steam Deck or other mixed Wayland/X11 sessions, OpenQ4-steamdeck prefers XWayland when both WAYLAND_DISPLAY and DISPLAY are present.
# 1. Configure
bash tools/build/meson_setup.sh setup --wipe builddir . --backend ninja --buildtype=debug --wrap-mode=forcefallback
# 2. Compile
bash tools/build/meson_setup.sh compile -C builddir
# 3. Run directly from builddir
./builddir/OpenQ4-client_x64Use -Dplatform_backend=native during setup if you need to compare against the legacy Linux X11/GLX backend.
# 1. Configure
bash tools/build/meson_setup.sh setup builddir . --backend ninja --buildtype=release --wrap-mode=forcefallback
# 2. Compile
bash tools/build/meson_setup.sh compile -C builddir
# 3. Stage distributable package into .install/
bash tools/build/meson_setup.sh install -C builddir --no-rebuild --skip-subprojects| File | Description |
|---|---|
OpenQ4-client_x64[.exe] |
Main engine executable |
OpenQ4-ded_x64[.exe] |
Dedicated server |
openq4/game-sp_x64[.dll/.so/.dylib] |
Single-player game module |
openq4/game-mp_x64[.dll/.so/.dylib] |
Multiplayer game module |
- BSE (Basic Set of Effects) is linked directly into
OpenQ4-client_x64; the dedicated server keeps a disabled/stub path. - On Windows, the wrapper also stages
OpenAL32.dlland the MSVC/UCRT runtime DLLs next to the executables so the tree is runnable without extra redistributables.
After running the install step, .install/ is a self-contained distributable package:
.install/
├── OpenQ4-client_x64[.exe] # Main executable
├── OpenQ4-ded_x64[.exe] # Dedicated server
├── OpenQ4-steamdeck # (Linux) Steam Deck launcher
├── OpenAL32.dll # (Windows) runtime dependency
├── share/applications/ # (Linux) desktop entries
└── openq4/
├── game-sp_x64[.dll/.so/.dylib] # Single-player module
├── game-mp_x64[.dll/.so/.dylib] # Multiplayer module
├── openq4_defaults.cfg # OpenQ4-owned default binds
└── openq4_profile_steamdeck.cfg # Steam Deck profile overrides
Note
Do not distribute raw buildtype=debug artifacts in public packages. MSVC import libraries (*.lib) are development-only artifacts and are not required in the package.
The meson install step (via the wrapper) stages all required binaries into .install/. This directory can be zipped and distributed as a release archive.
To include the icon set synchronisation step before building (validated and generated by the wrapper automatically):
# Set OPENQ4_SKIP_ICON_SYNC=1 to bypass icon sync in automated/CI workflows
$env:OPENQ4_SKIP_ICON_SYNC = "1"CI nightly builds set version_track=nightly to produce a version string such as X.Y.Z-nightly.20260307.1+gabcdef12.