Skip to main content
OpenRCT2 can be built from source on Linux, macOS, and Windows. Building from source allows you to:
  • Test the latest features before they are released
  • Contribute code changes to the project
  • Create custom builds with specific configurations
  • Debug issues in your development environment

Prerequisites

Before building OpenRCT2, you’ll need:

Build Tools

  • CMake 3.24 or later
  • C++ Compiler with C++20 support:
    • GCC 12 or later (Linux)
    • Clang 11 or later (Linux/macOS)
    • MSVC 2022 or later (Windows)
  • Ninja or Make (build system)
  • Git (to clone the repository)

Required Dependencies

OpenRCT2 requires several libraries to build:
  • SDL2 (graphics and input)
  • libzip (≥1.0)
  • zlib
  • libpng (≥1.6)
  • OpenSSL (1.0.0 or later)
  • libcurl (for HTTP support)
  • FreeType2 (for TTF font support)
  • fontconfig (Linux only, for TTF fonts)
  • ICU (internationalization)
  • zstd (compression)

Optional Dependencies

  • FLAC (for FLAC audio support)
  • Vorbis and Ogg (for OGG audio support)
  • OpenGL (for hardware rendering)
  • discord-rpc (for Discord Rich Presence)
  • Google Benchmark (for benchmarking, disabled by default)
  • CCache (to speed up recompilation)

Build Process

The general build process follows these steps:
1

Clone the repository

git clone https://github.com/OpenRCT2/OpenRCT2.git
cd OpenRCT2
2

Install dependencies

Install the required libraries for your platform (see platform-specific guides).
3

Create a build directory

mkdir build
cd build
Building in-source is not supported. Always create a separate build directory.
4

Configure with CMake

cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release
5

Build the project

ninja
6

Install (optional)

ninja install

Build Options

CMake provides several options to customize your build:
OptionDescriptionDefault
CMAKE_BUILD_TYPEBuild type (Debug, Release, RelWithDebInfo, MinSizeRel)Debug
DISABLE_GUIBuild headless only (no GUI)OFF
DISABLE_NETWORKDisable multiplayer functionalityOFF
DISABLE_HTTPDisable HTTP supportOFF
DISABLE_TTFDisable TrueType font supportOFF
DISABLE_OPENGLDisable OpenGL supportOFF
DISABLE_FLACDisable FLAC audio supportOFF
DISABLE_VORBISDisable OGG/Vorbis audio supportOFF
ENABLE_SCRIPTINGEnable plugin/script supportON
PORTABLECreate a portable buildOFF
WITH_TESTSBuild unit testsOFF
OPENRCT2_USE_CCACHEUse CCache for faster rebuildsON

Example: Building with custom options

cmake .. -G Ninja \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DWITH_TESTS=ON \
  -DDISABLE_DISCORD_RPC=ON

Platform-Specific Guides

Choose your platform for detailed build instructions:

Linux

Build on Ubuntu, Debian, Fedora, Arch, and other distributions

macOS

Build on macOS using CMake and Homebrew dependencies

Windows

Build on Windows using Visual Studio and vcpkg

WSL

Build on Windows Subsystem for Linux

MSYS2

Build on Windows using MSYS2 MinGW

Compiler Requirements

GCC 12+ is required. Older versions of GCC are known to fail compilation.
The project requires C++20 support:
  • GCC: Version 12.0 or later
  • Clang: Version 11.0 or later
  • MSVC: Visual Studio 2022 or later
  • Apple Clang: Xcode 13 or later

Common Build Issues

CMakeCache.txt already exists

If you see an error about building in-source:
rm -rf CMakeCache.txt CMakeFiles/
mkdir build && cd build
cmake ..

Missing dependencies

If CMake reports missing dependencies, install them using your platform’s package manager before running CMake again.

Linker errors with OpenSSL

On macOS, if you encounter OpenSSL linking issues:
brew install openssl@1.1
export CMAKE_PREFIX_PATH="$(brew --prefix openssl@1.1)"

Next Steps

After building OpenRCT2, you’ll need the original RollerCoaster Tycoon 2 game files to run it. See the Installation Guide for details on setting up the game data.