Skip to content

11 Building on MacOS

TellowKrinkle edited this page Mar 18, 2024 · 3 revisions

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.

Building on an Intel Mac

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.

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

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

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.

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.