Compiling OpenMW for Apple Silicon

OpenMW running natively on my Apple Silicon laptop

I recently managed to compile OpenMW for Apple Silicon. These are brief notes on how to do it. This is still less stable than the x86–64 version.

Instructions are adapted from this OpenMW wiki page: https://webcache.googleusercontent.com/search?q=cache:djVFTKYH5MgJ:https://wiki.openmw.org/index.php/Development_Environment_Setup+&cd=1&hl=en&ct=clnk&gl=us&client=safari

  1. Make sure you have Xcode and brew installed
brew install cmake
brew install pkg-config
brew install qt@5
brew install lz4

3. Clone my fork of the OpenMW dependency repository (I’ve only added one commit in case you’re interested in cherry picking it):

git clone git@github.com:enzuru/openmw-deps-mac.git
cd openmw-deps-mac
git fetch
git checkout adjust-for-apple-silicon
cd src
mkdir build
cmake ..
make

4. The above step will fail first due to an issue with the Boost library. You’ll need to open this file…

emacs /openmw-deps-mac/src/boost/tools/build/src/tools/darwin.jam

…and comment out line 143:

#flags darwin.compile.c++ OPTIONS $(condition) : -fcoalesce-templates ;

5. Compile again and that should complete the dependencies step:

cd openmw-deps-mac/src
make

6. Pull the offical OpenMW repository and compile:

# Adjust these paths according to your setup
export PATH_TO_DEPENDENCIES_DIR=/Users/enzuru/src/openmw-deps-mac/build/openmw-deps
export PATH_TO_QT_INSTALLATION=/opt/homebrew/Cellar/qt@5/5.15.2/lib/cmake

git clone https://gitlab.com/OpenMW/openmw/
cd openmw
mkdir build
cmake -D CMAKE_PREFIX_PATH="$PATH_TO_DEPENDENCIES_DIR;$PATH_TO_QT_INSTALLATION" -D CMAKE_BUILD_TYPE=Debug -G"Unix Makefiles" ../openmw/
make

7. You will now have new .app files that you can open:

open OpenMW.app
open OpenMW-CS.app

pesky lisper (https://enzu.ru)