mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-01-30 11:04:35 +00:00
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
2.4 KiB
2.4 KiB
Building shadPS4 with Docker and VSCode Support
This guide explains how to build shadPS4 using Docker while keeping full compatibility with VSCode development.
Prerequisites
Before starting, ensure you have:
-
Docker Engine or Docker Desktop installed
Installation Guide -
Git installed on your system.
Step 1: Prepare the Docker Environment
Inside the container (or on your host if mounting volumes):
- Navigate to the repository folder containing the Docker Builder folder:
cd <path-to-repo>
- Start the Docker container:
docker compose up -d
This will spin up a container with all the necessary build dependencies, including Clang, CMake, SDL2, Vulkan, and more.
Step 2: Clone shadPS4 Source
mkdir emu
cd emu
git clone --recursive https://github.com/shadps4-emu/shadPS4.git .
or your fork link.
- Initialize submodules:
git submodule update --init --recursive
Step 3: Build with CMake Tools (GUI)
Generate build with CMake Tools.
- Go
CMake Tools > Configure > '>' - And
Build > '>'
Compiled executable in Build folder.
Alternative Step 3: Build with CMake
Generate the build directory and configure the project using Clang:
cmake -S . -B build/ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
Then build the project:
cmake --build ./build --parallel $(nproc)
- Tip: To enable debug builds, add -DCMAKE_BUILD_TYPE=Debug to the CMake command.
After a successful build, the executable is located at:
./build/shadps4
Step 4: VSCode Integration
- Open the repository in VSCode.
- The CMake Tools extension should automatically detect the build directory inside the container or on your host.
- You can configure build options, build, and debug directly from the VSCode interface without extra manual setup.
Notes
- The Docker environment contains all dependencies, so you don’t need to install anything manually.
- Using Clang inside Docker ensures consistent builds across Linux and macOS runners.
- GitHub Actions are recommended for cross-platform builds, including Windows .exe output, which is not trivial to produce locally without Visual Studio or clang-cl.