This tutorial reads as if you have none of the prerequisites already installed. If you do, just ignore the steps regarding installation.
Warning
If you are trying to compile older builds for testing, do not provide the --depth 1 flag in git clone.
This flag omits the commit history from your clone, saving storage space while preventing you from testing older commits.
Note: ARM64 is not supported! As of writing, it will not build nor run. The instructions with respect to ARM64 are for developers only.
(Prerequisite) Download the Community edition from Visual Studio 2022
Once you are within the installer:
- Select
Desktop development with C++ - Go to "Individual Components" tab then search and select both
C++ Clang Compiler for WindowsandMSBuild support for LLVM - Continue the installation
(Prerequisite) Download Git for Windows
Go through the Git for Windows installation as normal
- Open Git for Windows, navigate to a place where you want to store the shadPS4 source code folder
- Clone the repository by running
git clone --depth 1 --recursive https://github.com/shadps4-emu/shadPS4
- Open up Visual Studio, select
Open a local folderand select the folder with the shadPS4 source code. The folder should containCMakeLists.txt - Change Clang x64 Debug to Clang x64 Release if you want a regular, non-debug build.
- Change the project to build to shadps4.exe
- Build -> Build All
Your shadps4.exe will be in C:\path\to\source\Build\x64-Clang-Release\
If your default IDE is VSCode, we have a fully functional example for that as well.
The main reason we use clang19 is because that version is used in CI for formatting.
- Go through the Git for Windows installation as normal
- Download and Run LLVM Installer and
Add LLVM to the system PATH for all users - Download and Run CMake Installer and
Add CMake to the system PATH for all users - Download Ninja and extract it to
C:\ninjaand add it to the system PATH for all users- You can do this by going to
Search with Start Menu -> Environment Variables -> System Variables -> Path -> Edit -> New -> C:\ninja
- You can do this by going to
git --version
# git version 2.49.0.windows.1
cmake --version
# cmake version 4.2.3
ninja --version
# 1.13.2
clang --version
# clang version 19.1.1- Download Visual Studio Build Tools
- Select
MSVC - Windows SDKand install (you don't need to install an IDE)
- Or you can install via
.vsconfigfile:
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
"Microsoft.Component.MSBuild",
"Microsoft.VisualStudio.Component.CoreBuildTools",
"Microsoft.VisualStudio.Workload.MSBuildTools",
"Microsoft.VisualStudio.Component.Windows10SDK",
"Microsoft.VisualStudio.Component.VC.CoreBuildTools",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
"Microsoft.VisualStudio.Component.Windows11SDK.26100",
"Microsoft.VisualStudio.Component.TestTools.BuildTools",
"Microsoft.VisualStudio.Component.VC.ASAN",
"Microsoft.VisualStudio.Component.TextTemplating",
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
"Microsoft.VisualStudio.Workload.VCTools"
],
"extensions": []
}
Save the file as `.vsconfig` and run the following command:
%userprofile%\Downloads\vs_BuildTools.exe --passive --config ".vsconfig"
Be carefull path to vs_BuildTools.exe and .vsconfig file.
This will install the necessary components to build shadPS4.
shadps4/
├── shared (shadps4 main files)
└── shadps4.code-workspace
{
"folders": [
{
"path": "shared"
}
],
"settings": {
"cmake.generator": "Ninja",
"cmake.configureEnvironment": {
"CMAKE_CXX_STANDARD": "23",
"CMAKE_CXX_STANDARD_REQUIRED": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"cmake.configureOnOpen": false,
"C_Cpp.intelliSenseEngine": "Disabled",
"clangd.arguments": [
"--background-index",
"--clang-tidy",
"--completion-style=detailed",
"--header-insertion=never",
"--compile-commands-dir=Build/x64-Clang-Release"
],
"editor.formatOnSave": true,
"clang-format.executable": "clang-format"
},
"extensions": {
"recommendations": [
"llvm-vs-code-extensions.vscode-clangd",
"ms-vscode.cmake-tools",
"xaver.clang-format"
]
}
}- Open your terminal and where to shadPS4 folder:
cd shadps4\shared - Clone the repository by running
git clone --depth 1 --recursive https://github.com/shadps4-emu/shadPS4 .
or fork link
- If you have already cloned repo:
git submodule update --init --recursive- CMake Tools
- Clangd
- Clang-Format
These plugins are suggested in the workspace file above and are already configured.
- Open VS Code,
File > Open workspace from file > shadps4.code-workspace - Go to the CMake Tools extension on left side bar
- Change Clang x64 Debug to Clang x64 Release if you want a regular, non-debug build.
- Click build.
Your shadps4.exe will be in shadps4\shared\Build\x64-Clang-Release\
Important
Building with MSYS2 is broken as of right now, the only way to build on Windows is to use Option 1: Visual Studio 2022 or Option 2: VSCode with Visual Studio Build Tools.
(Prerequisite) Download MSYS2
Go through the MSYS2 installation as normal
If you are building to distribute, please omit -DCMAKE_CXX_FLAGS="-O2 -march=native" within the build configuration step.
Normal x86-based computers, follow:
- Open "MSYS2 MINGW64" from your new applications
- Run
pacman -Syu, let it complete; - Run
pacman -S --needed git mingw-w64-x86_64-binutils mingw-w64-x86_64-clang mingw-w64-x86_64-cmake mingw-w64-x86_64-rapidjson mingw-w64-x86_64-ninja mingw-w64-x86_64-ffmpeg - Run
git clone --depth 1 --recursive https://github.com/shadps4-emu/shadPS4 - Run
cd shadPS4 - Run
cmake -S . -B build -DCMAKE_C_COMPILER="clang.exe" -DCMAKE_CXX_COMPILER="clang++.exe" -DCMAKE_CXX_FLAGS="-O2 -march=native" - Run
cmake --build build - To run the finished product, run
./build/shadPS4.exe
ARM64-based computers, follow:
- Open "MSYS2 CLANGARM64" from your new applications
- Run
pacman -Syu, let it complete; - Run
pacman -S --needed git mingw-w64-clang-aarch64-binutils mingw-w64-clang-aarch64-clang mingw-w64-clang-aarch64-rapidjson mingw-w64-clang-aarch64-cmake mingw-w64-clang-aarch64-ninja mingw-w64-clang-aarch64-ffmpeg - Run
git clone --depth 1 --recursive https://github.com/shadps4-emu/shadPS4 - Run
cd shadPS4 - Run
cmake -S . -B build -DCMAKE_C_COMPILER="clang.exe" -DCMAKE_CXX_COMPILER="clang++.exe" -DCMAKE_CXX_FLAGS="-O2 -march=native" - Run
cmake --build build - To run the finished product, run
./build/shadPS4.exe
These builds may not be easily copyable to people who do not also have a MSYS2 installation. If you want to distribute these builds, you need to copy over the correct DLLs into a distribution folder. In order to run them, you must be within the MSYS2 shell environment.


