Adding some information about compiling with non-default macOS SDKs. Adding the git command for installing submodules. Added information for CMake flags. Fixed the update section. Added Running section to make more sense

Nick 2021-10-09 15:53:30 -04:00
parent b54b2bba54
commit 70bf069bd7
1 changed files with 33 additions and 8 deletions

@ -1,6 +1,6 @@
## Minimum macOS
macOS Sierra (10.12) or newer is required to build Dolphin.
macOS Sierra (10.12) or newer is required to build Dolphin.
## Install Xcode
@ -12,6 +12,8 @@ After Xcode has been downloaded and installed, the active developer directory mu
sudo xcode-select -s /path/to/Xcode.app/Contents/Developer
```
**Note:** Make sure you have the correct version of Xcode installed with the macOS SDK for your OS version. Specifically, macOS 10.13 runs up to Xcode 10, and Xcode 10 only has the macOS 14 SDK. You can download other versions of Xcode and extract the macOS SDK to add to your existing Xcode installation if needed.
## Install Qt
Install Qt5 from the qt.io website
@ -34,12 +36,18 @@ To checkout Dolphin's source:
```bash
git clone https://github.com/dolphin-emu/dolphin ~/dolphin-emu
cd ~/dolphin-emu
cd ./dolphin-emu
```
To build with CMake (optionally verbose): Download and install [CMake](https://cmake.org/download/) if you don't have it.
Pull the git submodules (required for mGBA integration)
Then:
```bash
git submodule update --init
```
Download and install [CMake](https://cmake.org/download/) if you don't have it.
To build with CMake (optionally verbose):
```bash
mkdir -p build
@ -51,12 +59,18 @@ make
#### CMake Notes
The `-j` option can be passed to `make` in order to compile multiple objects at once.
A good rule of thumb is number of CPU cores plus one. For example, on a quad core CPU `make -j5` would be a good choice.
A good rule of thumb is number of CPU cores plus one. For example, on a quad core CPU `make -j5` would be a good choice. To use all threads available, run `make -j$(nproc)`.
You can execute `cmake -L` to view the options that Dolphin's CMake environment supports, as well as their current and possible settings.
If you have any problems compiling, use the verbose option (`make VERBOSE=1`) to give more detail. If you report a problem, at a minimum include the last screen-full of lines.
To have CMake specify a macOS SDK, add the following flags when calling CMake. Replace 10.XX with the macOS version number. The default location for Xcode to store the macOS SDK is: `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/`
```
-DCMAKE_OSX_SYSROOT=<path_to_SDK>/MacOSX10.XX.sdk/ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.XX
```
## Optional: Ninja
[Ninja](https://ninja-build.org/) is a replacement for Make which is a bit faster for a Dolphin-sized project and is worth considering if you intend to rebuild frequently.
@ -70,12 +84,23 @@ To fix this, pass to CMake:
-DCMAKE_CXX_FLAGS="-Xclang -fcolor-diagnostics"
```
## Running Dolphin
After Dolphin is compiled, the .app bundle will be located at `dolphin-emu/build/Binaries/Dolphin.app`. This can be copied to Applications if desired.
Or to run directly from the build folder:
```bash
open ./dolphin-emu/build/Binaries/Dolphin.app
```
## Keeping Up to Date
All you need to do to update to the latest Dolphin revision is the following:
```bash
cd ~/dolphin-emu/build
git pull
make && open Binaries/*
cd ./dolphin-emu
git pull origin
cd build
cmake .. && make
```