shadPS4/documents/building-docker.md
Berk b17ac0fdda
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
Fix most of vscode problems and switch to Arch for more stability (#3964)
2026-01-27 15:59:56 +02:00

2.4 KiB
Raw Permalink Blame History

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):

  1. Navigate to the repository folder containing the Docker Builder folder:
cd <path-to-repo>
  1. 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.
  1. Initialize submodules:
git submodule update --init --recursive

Step 3: Build with CMake Tools (GUI)

Generate build with CMake Tools.

  1. Go CMake Tools > Configure > '>'
  2. 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

  1. Open the repository in VSCode.
  2. The CMake Tools extension should automatically detect the build directory inside the container or on your host.
  3. 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 dont 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.