Skip to main content
This guide covers building Prism Launcher from source on all supported platforms.

Build Requirements

System Requirements

  • CMake: 3.22 or higher (minimum version required by Qt)
  • C++ Compiler: Support for C++20 standard
  • C Compiler: Support for C11 standard
  • Qt: Version 6.4 or higher
  • Git: For cloning and submodule management

Required Dependencies

sudo apt install build-essential cmake git \
  qt6-base-dev qt6-base-dev-tools \
  libqt6core5compat6-dev qt6-network-auth-dev \
  libgl1-mesa-dev zlib1g-dev libarchive-dev \
  libqrencode-dev libtomlplusplus-dev libcmark-dev
On Linux, the project requires libgamemode for GameMode support and libqrencode for QR code functionality.

Build Configuration

CMake Build Types

The project supports standard CMake build types:
  • Debug: Debug information included, no optimizations, Address Sanitizer optional
  • Release: Full optimizations (-O2 -D_FORTIFY_SOURCE=2)
  • RelWithDebInfo: Optimizations with debug information
  • MinSizeRel: Size-optimized release build

Important CMake Options

# Qt version (default: 6)
-DLauncher_QT_VERSION_MAJOR=6

# Build platform identifier
-DLauncher_BUILD_PLATFORM="archlinux"

# Enable tests
-DBUILD_TESTING=ON

# Enable Link Time Optimization
-DENABLE_LTO=ON

# Enable Address Sanitizer for Debug builds
-DDEBUG_ADDRESS_SANITIZER=ON

# Precompiled headers (default: ON)
-DLauncher_USE_PCH=ON

# Java downloader feature (auto-disabled on Linux/BSD)
-DLauncher_ENABLE_JAVA_DOWNLOADER=ON
In-source builds are not allowed. CMake will fail if CMAKE_SOURCE_DIR equals CMAKE_BUILD_DIR.

Platform-Specific Instructions

Standard Build

1

Clone and Initialize

git clone https://github.com/PrismLauncher/PrismLauncher.git
cd PrismLauncher
git submodule update --init --force
2

Configure Build

mkdir build && cd build
cmake .. \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX="/usr" \
  -DLauncher_BUILD_PLATFORM="$(lsb_release -si | tr '[:upper:]' '[:lower:]')"
3

Build

cmake --build . -j$(nproc)
4

Install (Optional)

sudo cmake --install .

Portable Installation

For a portable installation that doesn’t require system-wide installation:
cmake --install . --prefix ./install --component portable
This creates a launcher script and portable.txt file in the installation directory.

Runtime Path (RPATH)

On Linux, the binary RPATH is set to $ORIGIN/ to load libraries from the same directory.

Advanced Build Options

Enable LTO for smaller, faster binaries:
cmake .. -DENABLE_LTO=ON
LTO is automatically enabled for Release and MinSizeRel builds if the compiler supports it.

Address Sanitizer

Enable Address Sanitizer for debugging memory issues:
cmake .. -DCMAKE_BUILD_TYPE=Debug -DDEBUG_ADDRESS_SANITIZER=ON
This enables both AddressSanitizer and UndefinedBehaviorSanitizer in Debug builds.

Custom API Keys

If you’re creating a fork or custom build, you must either remove or replace the API keys in CMakeLists.txt.
API keys in the project:
# Microsoft Identity Platform (for Xbox/Microsoft accounts)
set(Launcher_MSA_CLIENT_ID "...")

# CurseForge API (for mod downloads)
set(Launcher_CURSEFORGE_API_KEY "...")

# Imgur (for screenshot uploads)
set(Launcher_IMGUR_CLIENT_ID "...")
To disable features:
set(Launcher_MSA_CLIENT_ID "")
set(Launcher_CURSEFORGE_API_KEY "")
set(Launcher_IMGUR_CLIENT_ID "")
By using the provided API keys, you accept the Microsoft Identity Platform Terms and CurseForge API Terms.

Testing

Run the test suite:
cd build
ctest
Or with verbose output:
ctest --output-on-failure
Disable tests during configuration:
cmake .. -DBUILD_TESTING=OFF

Compiler Compatibility

The build system is tested with:
  • GCC: 10 or later
  • Clang: 12 or later
  • MSVC: Visual Studio 2019 or later
  • AppleClang: Xcode 13 or later

Troubleshooting

Qt Not Found

If CMake can’t find Qt, specify the Qt installation path:
cmake .. -DCMAKE_PREFIX_PATH="/path/to/Qt/6.x/gcc_64"

Submodule Issues

If you encounter submodule-related errors:
git submodule sync
git submodule update --init --force --recursive

Stack Size Errors on Windows

The build sets an 8 MiB stack size automatically. If you still encounter stack overflow:
# Check that the stack size is properly set
link /DUMP /HEADERS prismlauncher.exe | findstr /C:"stack"

macOS Icon Compilation

If asset compilation fails, ensure you have:
  • Xcode 26.0+ installed
  • Command line tools: xcode-select --install
  • actool in your PATH

Distribution Packaging

If you’re packaging Prism Launcher for a distribution, set Launcher_BUILD_PLATFORM to identify your distribution (e.g., archlinux, fedora, nixpkgs).
Example for Arch Linux:
cmake .. -DLauncher_BUILD_PLATFORM="archlinux"
This information is displayed in the About dialog.