11 Building on MacOS - Shoegzer/pcsx2 GitHub Wiki

General

Reminder: Don't forget to checkout submodules! git submodule update --init --recursive in the source directory if you're not sure whether you've done it or not.

Dependencies:

  • libpng
  • libjpeg
  • qt6 (qt6 on Homebrew, qt6-qtbase, qt6-qtsvg, and qt6-qttools on MacPorts)

The following dependencies will be built from submodules if not found, but installing them can speed up builds:

  • zstd
  • libzip
  • sdl2
  • rapidyaml
  • fmt

Building on an Intel Mac

Building on an Intel Mac should work similarly to building on Linux. Run cmake with cmake /path/to/pcsx2/source -DCMAKE_BUILD_TYPE=Release, then make. The final .app will be in pcsx2-qt/PCSX2.app in the build directory.

Building on an arm (Apple Silicon) Mac

PCSX2 does not support building for arm. You will need to make Intel builds even on Apple Silicon and run them in Rosetta.

You will need Intel versions of all the dependencies. Dependencies from Homebrew will not work. 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). If you don't use MacPorts, you'll need to build manually. You can use the CI's dependency installation script as reference, just add -DCMAKE_OSX_ARCHITECTURES=x86_64;arm64 on cmake stuff (e.g. qt) and CC="clang -arch x86_64 -arch arm64" CXX="clang -arch x86_64 -arch arm64" for autotools things.

Add the following extra flags to the cmake invocation listed in the Intel Mac section:

  • -DCMAKE_OSX_ARCHITECTURES=x86_64. This tells cmake to do an Intel build even though you're on an arm Mac.
  • -DARCH_FLAG="". This overrides our default setting of -march=native, which doesn't work when building Intel builds from Apple Silicon.

Building for development

The following extra cmake flags may be useful when building for working on PCSX2:

  • -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.
  • -G Xcode. Tells cmake to generate an Xcode project instead of makefiles. Allows you to use Xcode to work on PCSX2.