2022-01-27 12:46:58 +00:00
# Build Instructions
2013-09-22 14:32:55 +01:00
2022-10-18 14:38:32 +01:00
Full build instructions will be available on [the website ](https://prismlauncher.org/wiki/development/build-instructions/ ).
2015-09-30 21:00:31 +01:00
2022-10-18 14:57:43 +01:00
If you would like to contribute or fix an issue with the Build instructions you will be able to do so [here ](https://github.com/PrismLauncher/website/blob/master/src/wiki/development/build-instructions.md ).
2022-10-18 14:35:40 +01:00
< h2 > Getting the source< / h2 >
Clone the source code using git, and grab all the submodules. This is generic for all platforms you want to build on.
```
2022-10-18 14:57:43 +01:00
git clone --recursive https://github.com/PrismLauncher/PrismLauncher
2022-10-18 14:35:40 +01:00
cd PrismLauncher
```
< h2 > Linux< / h2 >
2022-10-18 14:52:00 +01:00
This guide will mostly mention dependant packages by their Debian naming and commands are done by a user in the sudoers file.
2022-10-18 14:35:40 +01:00
< h3 > Dependencies< / h3 >
2022-10-18 14:52:00 +01:00
- A C++ compiler capable of building C++17 code (can be found in the package `build-essential` ).
2022-10-18 14:35:40 +01:00
- Qt Development tools 5.12 or newer (on Debian 11 or Debian-based distributions, `qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5` ).
- `cmake` 3.15 or newer.
- `extra-cmake-modules` .
- zlib (`zlib1g-dev` on Debian 11 or Debian-based distributions).
- Java Development Kit (Java JDK) (`openjdk-17-jdk` on Debian 11 or Debian-based distributions).
2022-10-18 14:37:11 +01:00
- Mesa GL headers (`libgl1-mesa-dev` on Debian 11 or Debian-based distributions).
2022-10-18 14:35:40 +01:00
- (Optional) `scdoc` to generate man pages.
2022-10-18 14:52:00 +01:00
In conclusion, to check if all you need is installed (including optional):
```
sudo apt install build-essential qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5 cmake extra-cmake-modules zlib1g-dev openjdk-17-jdk libgl1-mesa-dev scdoc
```
2022-10-18 14:35:40 +01:00
< h3 > Compiling< / h3 >
2022-10-18 14:37:11 +01:00
< h4 > Building and installing on the system< / h4 >
2022-10-18 14:52:00 +01:00
This is usually the suggested way to build the client.
2022-10-18 14:37:11 +01:00
2022-10-18 14:35:40 +01:00
```
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/usr" -DENABLE_LTO=ON
cmake --build build -j$(nproc)
sudo cmake --install build
```
2022-10-18 14:37:11 +01:00
2022-10-18 14:35:40 +01:00
< h4 > Building a portable binary< / h4 >
2022-10-18 14:37:11 +01:00
2022-10-18 14:35:40 +01:00
```
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install
cmake --build build -j$(nproc)
cmake --install build
cmake --install build --component portable
```
2022-10-18 14:37:11 +01:00