Skip to content

Build Instructions

Compiling manually

Prerequisites

  • A C++ compiler supporting at least C++17.
    • This will be GCC >= 8, Clang >= 5, and MSVC >= 19.15
  • cmake >= 3.15
  • ninja (optional, speeds up builds)
  • extra-cmake-modules (optional, available in a submodule)
  • Java JDK
  • Qt 6.0 or later
    • Alternatively, you can use Qt 5.12 or newer. This will be removed in Prism X (10.0).
  • cmark (optional, vendored in a submodule)
  • gamemode (used at runtime, only on Linux)
  • ghc-filesystem (optional, vendored in a submodule)
  • libGL headers (only on Linux)
  • quazip (optional, vendored in a submodule)
  • scdoc (optional, used to generate manpages)
  • tomlplusplus (optional, vendored in a submodule)
  • zlib (optional, vendored in a submodule)

You should first install winget, a package manager for Windows.

Once winget is available, install the MSVC toolchain with:

Terminal window
$ winget install --exact --id Microsoft.VisualStudio.2022.BuildTools --source winget

We will also be using Git:

Terminal window
$ winget install --exact --id Git.Git --source winget

Qt can then be installed with aqt:

Terminal window
$ winget install --exact --id miurahr.aqtinstall --source winget
$ aqt install-qt windows desktop 6.7.3 win64_msvc2019 -m qtimageformats qtnetworkauth qt5compat

Getting the source

We use Git for our version control. The command below will clone the repository, and fetch all submodules that come with it

Terminal window
$ git clone --recursive https://github.com/PrismLauncher/PrismLauncher.git
$ cd PrismLauncher

The rest of the documentation assumes you have already cloned the repository.

Building the source

Configuration

Open “x64 Native Tools PowerShell” in Windows Terminal

Terminal window
cmake -S . -B build -G Ninja `
<# -D CMAKE_BUILD_TYPE="Release" #> ` # If you want to build with optimizations
-D CMAKE_PREFIX_PATH=".\6.7.0\win64_msvc2019\lib\cmake" `
-D CMAKE_INSTALL_PATH="install" `
<# -D ENABLE_LTO=ON #> ` # If you want to enable LTO
<# -D Launcher_QT_VERSION_MAJOR="5" #> # If you want to use Qt 5

Compilation

Terminal window
cmake --build build -- /p:UseMultiToolTask=true /p:EnforceProcessCountAcrossBuilds=true

Installation

Terminal window
cmake --install build
cmake --install build --component portable # If you want to install a portable version

Building with Nix (Linux and macOS)

Nix is a tool for handling reproducible builds across multiple platforms.

After installing Nix, you can run the following command to build a debug package:

Terminal window
nix build --print-build-logs github:PrismLauncher/PrismLauncher#prismlauncher-debug

You can also enter a development shell with all of the tools required to build manually:

Terminal window
nix develop
cmake -S . -B build -G Ninja -D CMAKE_INSTALL_PREFIX="install"
cmake --build build
cmake --install build

Building a Flatpak (Linux)

Flatpaks allow for you to quickly build Prism and run it on any distribution

Make sure Flathub is setup.

Terminal window
# Install Flatpak build tools
flatpak install flathub org.flatpak.Builder
# Clone the source repository
git clone --recursive https://github.com/prismlauncher/PrismLauncher
# Enter the Flatpak directory
cd PrismLauncher/flatpak
# Run the build
flatpak run org.flatpak.Builder \
--user \
--install \ # Comment if you only want to build, not install
--install-deps-from=flathub \
--ccache \
--repo=repo \
builddir \
org.prismlauncher.PrismLauncher.yml