You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This page helps you build PCSX2 locally on your machine.
10
-
11
-
## Building on Windows
9
+
import Tabs from '@theme/Tabs';
10
+
import TabItem from '@theme/TabItem';
12
11
13
-
### Required Dependencies for Qt
12
+
This page helps you build PCSX2 locally on your machine.
14
13
15
-
If you are developing against the `pcsx2-qt` solution, you will need to do the following:
14
+
## Building the Application
16
15
17
-
- Download the binaries [from here](https://github.com/PCSX2/pcsx2-windows-dependencies/releases/)
18
-
- tools / symbols are not required
19
-
- Extract into the main folder (where the `PCSX2_qt.sln` file is); you should see a new `deps` folder after extraction
20
-
- Ensure you have opened the `*-qt` .sln file.
16
+
<TabsqueryString="os">
17
+
<TabItemvalue="windows"label="Windows"default>
21
18
22
-
### Required Build Applications
19
+
To build PCSX2 on Windows, you will need the following applications:
23
20
24
21
<!-- MS has a handy list with names here https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2019 -->
25
22
26
23
-[Visual Studio Community](https://www.visualstudio.com/downloads/)
27
-
- Installing just the "Desktop development with C++" workload should be enough, otherwise select individually:
28
-
- C++ ATL for v142 build tools (x86 & x64)
29
-
- MSVC v142 - VS 2019 C++ x64/x86 build tools
30
-
- Windows 10 SDK
31
24
-[Git for Windows](https://git-scm.com/download/win)
32
25
33
-
### Other Requirements
26
+
:::note[Note – Visual Studio]
27
+
28
+
- Installing just the "Desktop development with C++" workload should be enough.
29
+
- Otherwise, select individually:
30
+
- C++ Active Template Library (ATL) for v142 build tools (x86 & x64)
31
+
- MSVC v142 - VS 2019 C++ x64/x86 build tools
32
+
- Windows 10 SDK
33
+
:::
34
+
35
+
Next, in order to obtain the necessary Qt dependencies:
36
+
37
+
1. Download the binaries [from here](https://github.com/PCSX2/pcsx2-windows-dependencies/releases/).
38
+
- Tools / symbols are not required.
39
+
2. Extract into the main folder (where the `PCSX2_qt.sln` file is).
40
+
- You should see a new `deps` folder after extraction.
41
+
3. Ensure you have opened the `*-qt` .sln file.
42
+
43
+
Optionally, widescreen and no-interlacing cheats are sourced from [a separate repository](https://github.com/PCSX2/pcsx2_patches). You might consider putting them in your working directory to ensure your development environment matches shipping builds:
44
+
45
+
1. Download both `.zip` files from [the releases page.](https://github.com/PCSX2/pcsx2_patches/releases/)
46
+
2. Place them (without extracting) in `bin/resources`.
47
+
48
+
</TabItem>
49
+
<TabItemvalue="macos"label="macOS">
50
+
51
+
:::note[Note – Xcode]
52
+
You will need to have Xcode installed to use our CI's build script.
Widescreen and No-Interlacing cheats are sourced from [a separate repository](https://github.com/PCSX2/pcsx2_patches). You might consider putting them in your working directory to ensure your development environment matches shipping builds:
60
+
- PCSX2 does not support building for ARM.
61
+
- On Apple Silicon, you will still need to make Intel builds and run them in Rosetta.
62
+
- Dependencies from Homebrew will not work.
63
+
:::
36
64
37
-
- Download both `.zip` files from here: https://github.com/PCSX2/pcsx2_patches/releases/
38
-
- Put them (without extracting) in `bin/resources`.
65
+
You will need Intel versions of all the dependencies. The dependency build script will handle this for you (see Intel instructions). If you use MacPorts, install your packages with `+universal`. We do not link to any libraries from `qt6-qttools`, so you can skip the universal on that one (and it links with libclang, so we recommend skipping it unless you really want to sit around while MacPorts builds a universal build of Clang and LLVM).
39
66
40
-
## Building On Linux
67
+
Add the following extra flags to the CMake invocation listed in the Intel Mac section:
41
68
42
-
This guide demonstrates how to build PCSX2 in Linux environments. Note that the steps provided below may vary depending on the distribution - such variances are not officially supported by the PCSX2 team.
69
+
-`-DCMAKE_OSX_ARCHITECTURES=x86_64`
70
+
- Tells CMake to do an Intel build.
43
71
44
-
Note that the procedure defined herein closely mirrors the scripts used by the PCSX2 CI process. These scripts provide more information behind the build process than what is stated here.
Build the dependencies using the CI's build script: `.github/workflows/scripts/macos/build-dependencies.sh deps` (this will build the dependencies into the directory `deps`). If you want to use a package manager, you can look at the install script to see the required dependencies.
76
+
77
+
You can set the environment variable `BUILD_FFMPEG=0` to tell the dependency build script to build all the dependencies except ffmpeg, allowing you to use your homebrew or macports-installed ffmpeg, which probably has more features enabled than the build script's.
78
+
79
+
Building on an Intel Mac should work similarly to building on Linux. Run CMake with `cmake /path/to/pcsx2/source -DCMAKE_PREFIX_PATH=/path/to/deps -DCMAKE_BUILD_TYPE=Release`, then `make`. The final `.app` will be in `pcsx2-qt/PCSX2.app` in the build directory. (The `CMAKE_PREFIX_PATH` is only needed if you used the CI's build script to install dependencies.)
80
+
81
+
Add `-DUSE_LINKED_FFMPEG=ON` for video capture support.
82
+
83
+
</TabItem>
84
+
</Tabs>
48
85
49
-
### Dependencies
86
+
<details>
87
+
<summary>Expand to see optional flags which may be useful for PCSX2 development</summary>
50
88
51
-
Note that dependencies tend to change over time, along with their required versions. In particular, PCSX2 no longer supports the gcc compiler, as it has transitioned to clang/llvm due to the many benefits the latter compiler offers, including superior efficiency and speed.
89
+
-`-DSKIP_POSTPROCESS_BUNDLE=ON`
90
+
- Disables a post-build step that fixes up all the dependencies and shoves them into the app bundle for easy distribution.
91
+
- Saves time on incremental builds.
92
+
-`-G Xcode`
93
+
- Tells CMake to generate an Xcode project instead of makefiles.
94
+
- Allows you to use Xcode to work on PCSX2.
52
95
53
-
#### Ubuntu Package List
96
+
</details>
97
+
98
+
</TabItem>
99
+
<TabItemvalue="linux"label="Linux">
100
+
101
+
:::info[Info – Build process]
102
+
The procedure outlined here closely mirrors the scripts used by the PCSX2 CI process. The following scripts provide more information behind the build process than what is stated here:
The following package list is sufficient for building PCSX2 as of 2024/04/06 with Fedora 39. You must build the third-party dependencies using the script from the CI, as instructed below.
122
+
On Fedora, you must build third-party dependencies using the script from the CI as instructed below. The following package list is sufficient for building PCSX2 as of 6 April 2024 with Fedora 39:
On Arch, we recommend using the PKGBUILD file of the unofficial [`pcsx2-git` AUR package](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=pcsx2-git) maintained by WeirdBeard et al. as a reference. The packages listed under `depends` and `makedepends` are all required to build PCSX2, and the `optdepends` are optionally used for RetroAchievements, Wayland support, etc.
132
+
133
+
:::tip[Tip – Building dependencies]
134
+
On Arch, it is unlikely you will need to use the `build-dependencies-qt.sh` script discussed below, as by nature of being a rolling release distribution, your packages should always be up-to-date.
PCSX2 depends on multiple third-party libraries, which should be built for your development environment. We provide a convenience script for building these dependencies, which is also used by our CI runners for release builds.
215
+
PCSX2 depends on multiple third-party libraries, which should be built for your development environment. We provide a convenience script, `build-dependencies-qt.sh`, for building these dependencies, which is also used by our CI runners for release builds.
146
216
147
-
This will build the dependencies to your PCSX2 Git tree, in the `deps` directory. You can also specify an alternative location, but be sure to adjust `CMAKE_PREFIX_PATH` in the next step.
217
+
This script will build the dependencies in the `deps` directory of your PCSX2 Git tree. You can also specify an alternative location, but be sure to adjust `CMAKE_PREFIX_PATH` in the next step.
-`Debug` – Slowest build (no compiler optimizations) but has debug/crash information.
166
237
167
238
-`-DCMAKE_CXX_COMPILER_LAUNCHER=ccache`
168
239
169
-
- Uses ccache to speed up the build process
240
+
- Uses ccache to speed up the build process.
170
241
171
242
-`-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON`
172
-
- Turns on link time optimization, which provides a noticeable performance improvement.
243
+
- Turns on [link-time optimization](https://en.wikipedia.org/wiki/Interprocedural_optimization#WPO_and_LTO).
244
+
- Provides a noticeable performance improvement.
245
+
</details>
173
246
174
-
#### Execute build
247
+
Next, execute the build process:
175
248
176
249
```sh
177
250
ninja -C build
178
251
```
179
252
180
-
#### Running PCSX2
181
-
182
-
PCSX2 can be launched from the build directory:
253
+
Finally, PCSX2 can be launched from the build directory:
183
254
184
255
```sh
185
256
build/bin/pcsx2-qt
186
257
```
187
258
188
-
## Building on MacOS
189
-
190
-
### Building on an Intel Mac
191
-
192
-
Build the dependencies using the CI's build script: `.github/workflows/scripts/macos/build-dependencies.sh deps` (this will build the dependencies into the directory `deps`). If you want to use a package manager, you can look at the install script to see the required dependencies.
193
-
194
-
:::caution
195
-
You will need to have Xcode installed to use our CI's build script.
196
-
:::
197
-
198
-
You can set the environment variable `BUILD_FFMPEG=0` to tell the dependency build script to build all the dependencies except ffmpeg, allowing you to use your homebrew or macports-installed ffmpeg, which probably has more features enabled than the build script's.
199
-
200
-
Building on an Intel Mac should work similarly to building on Linux. Run cmake with `cmake /path/to/pcsx2/source -DCMAKE_PREFIX_PATH=/path/to/deps -DCMAKE_BUILD_TYPE=Release`, then `make`. The final `.app` will be in `pcsx2-qt/PCSX2.app` in the build directory. (The `CMAKE_PREFIX_PATH` is only needed if you used the CI's build script to install dependencies.)
201
-
202
-
Add `-DUSE_LINKED_FFMPEG=ON` for video capture support.
203
-
204
-
### Building on an ARM (Apple Silicon) Mac
205
-
206
-
:::warning
207
-
PCSX2 does not support building for ARM. You will need to make Intel builds even on Apple Silicon and run them in Rosetta.
208
-
:::
209
-
210
-
You will need Intel versions of all the dependencies. **Dependencies from Homebrew will not work.** The dependency build script will handle this for you (see Intel instructions). If you use MacPorts, install your packages with `+universal`. Note that we don't link to any libraries from `qt6-qttools`, so you can skip the universal on that one (and it links with libclang, so I'd recommend skipping it unless you really want to sit around while MacPorts builds a universal build of clang and llvm).
211
-
212
-
Add the following extra flags to the cmake invocation listed in the Intel Mac section:
213
-
214
-
-`-DCMAKE_OSX_ARCHITECTURES=x86_64`. This tells cmake to do an Intel build even though you're on an ARM Mac.
215
-
216
-
### Building for development
217
-
218
-
The following extra cmake flags may be useful when building for working on PCSX2:
219
-
220
-
-`-DSKIP_POSTPROCESS_BUNDLE=ON`. This disables a post-build step that fixes up all the dependencies and shoves them into the app bundle for easy distribution. Saves time on incremental builds.
221
-
-`-G Xcode`. Tells cmake to generate an Xcode project instead of makefiles. Allows you to use Xcode to work on PCSX2.
259
+
</TabItem>
260
+
</Tabs>
222
261
223
262
## Building GammaRay
224
263
225
-
[GammaRay](https://github.com/KDAB/GammaRay) is a debugging tool that lets you inspect the internal state of Qt applications. If you're working on the UI you may find it useful to build it alongside PCSX2 with one of the provided scripts, after building or downloading PCSX2's dependencies. This is entirely optional.
226
-
227
-
Windows:
264
+
[GammaRay](https://github.com/KDAB/GammaRay) is a free and open-source debugging tool that lets you inspect the internal state of Qt applications. After building or downloading PCSX2's dependencies, you may find it useful to build GammRay alongside PCSX2 with one of the provided scripts if you're working on the UI. This is entirely optional.
0 commit comments