mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-10-11 21:49:59 +00:00
docs: update Linux compiler instructions (#5000)
This commit is contained in:
@@ -5,7 +5,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
## Build shadPS4 for Linux
|
||||
|
||||
First and foremost, Clang 18 is the **recommended compiler** as it is used for official builds and CI. If you build with GCC, you might encounter issues — please report any you find. Additionally, if you choose to use GCC, please build shadPS4 with Clang at least once before creating an `[APP BUG]` issue or submitting a pull request.
|
||||
First and foremost, Clang 19 is the **recommended compiler** as it is used for official Linux builds and CI. GCC 14 is also tested by CI. If you build with GCC, you might encounter issues — please report any you find. Additionally, if you choose to use GCC, please build shadPS4 with Clang at least once before creating an `[APP BUG]` issue or submitting a pull request.
|
||||
|
||||
## Preparatory steps
|
||||
|
||||
@@ -13,8 +13,20 @@ First and foremost, Clang 18 is the **recommended compiler** as it is used for o
|
||||
|
||||
#### Debian & Ubuntu
|
||||
|
||||
Make sure Clang 19 is installed. On Ubuntu 24.04, the default `clang` package may still provide Clang 18, while the current Linux CI uses Clang 19 from apt.llvm.org.
|
||||
|
||||
For Ubuntu 24.04, add the LLVM 19 repository first:
|
||||
|
||||
```bash
|
||||
sudo apt install build-essential clang git cmake libasound2-dev \
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo add-apt-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main'
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
Then install the build dependencies:
|
||||
|
||||
```bash
|
||||
sudo apt install build-essential clang-19 git cmake libasound2-dev \
|
||||
libpulse-dev libopenal-dev libssl-dev zlib1g-dev libedit-dev \
|
||||
libudev-dev libevdev-dev libsdl2-dev libjack-dev libsndio-dev \
|
||||
libvulkan-dev vulkan-validationlayers libpng-dev
|
||||
@@ -96,7 +108,7 @@ There are 3 options you can choose from. Option 1 is **highly recommended**.
|
||||
1. Generate the build directory in the shadPS4 directory.
|
||||
|
||||
```bash
|
||||
cmake -S . -B build/ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
||||
cmake -S . -B build/ -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19
|
||||
```
|
||||
|
||||
To change the build type (for debugging), add `-DCMAKE_BUILD_TYPE=Debug`.
|
||||
@@ -122,7 +134,7 @@ You can also specify the Game ID as an argument for which game to boot, as long
|
||||
|
||||
Open `cmake-gui` and specify the source code and build directories. If you cloned the source code to your Home directory, it would be `/home/user/shadPS4` and `/home/user/shadPS4/build`.
|
||||
|
||||
Click on Configure, select "Unix Makefiles", select "Specify native compilers", click Next and choose `clang` and `clang++` as the C and CXX compilers. Usually they are located in `/bin/clang` and `/bin/clang++`. Click on Finish and let it configure the project.
|
||||
Click on Configure, select "Unix Makefiles", select "Specify native compilers", click Next and choose `clang-19` and `clang++-19` as the C and CXX compilers. Click on Finish and let it configure the project.
|
||||
|
||||
Now every option should be displayed in red. Change anything you want, then click on Generate to make the changes permanent, then open a terminal window and do step 2 of Option 1.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user