Skip to content

Build Instructions for macOS

jcm edited this page Nov 28, 2024 · 6 revisions

Note

This page applies to the in-development new build system. For current build instructions, see here.

Prerequisites

  • macOS 10.15 or higher
  • CMake 3.28 or higher
  • Xcode 12.4 or higher

Note: If you do not want to use Xcode, it is technically optional; however, the Xcode Command Line Tools are still required.

Cloning ares

First, clone the ares repository:

git clone https://github.com/ares-emulator/ares
cd ares

Xcode builds

The recommended build process involves generating an Xcode project, which may be done by using the macos CMake preset:

cmake --preset macos

This creates an Xcode project in the build_macos folder capable of building all ares targets including subprojects.

To build ares, launch the ares.xcodeproj project, select the desktop-ui target in the target dropdown and hit the build button.

By default, a single-architecture project with the host architecture is generated. To build universal binaries or cross-compile, the -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" option can be specified in addition to the preset.

You may also build ares with xcodebuild from the command line:

cd build_macos
xcodebuild build -quiet -configuration RelWithDebInfo DEBUG_INFORMATION_FORMAT="dwarf-with-dsym"

Non-Xcode builds

If you do not want to use Xcode, you may also build with other generators such as Make or Ninja. To do this, invoke CMake as normal:

mkdir my_build && cd my_build
cmake .. -G Ninja

After configuration, build ares. For example:

cmake --build . --target desktop-ui

For further configuration options, see the Build Options page.