Compiling Godot on MacOS

The documentation for compiling Godot is well written. The new tools are a little overwhelming at first but just follow the steps was good enough.

Building master branch

Fetching the latest master version then compiling I failed to compile the 3.2 version.

git checkout master
scons platform=osx arch=x86_64 --jobs=$(sysctl -n hw.logicalcpu)

gives some warnings and error.

Warning

YASM is necessary for WebM SIMD optimizations. WebM SIMD optimizations are disabled. Check if your CPU architecture, CPU bits or platform are supported!

Error

main/default_controller_mappings.gen.cpp:3:10: fatal error: 'main/default_controller_mappings.h' file not found
#include "main/default_controller_mappings.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
scons: *** [main/default_controller_mappings.gen.osx.tools.x86_64.o] Error 1

Warning

platform/osx/display_server_osx.mm:3723:2: warning: Forcing vulkan rendering driver because OpenGL not implemented yet [-W#warnings]
#warning Forcing vulkan rendering driver because OpenGL not implemented yet
 ^
1 warning generated.

Building 3.2 (latest stable)

When switching branch make sure to clean. I'm not sure whether that is necessary but let's be on the save side.

git checkout 3.2
scons --clean
scons platform=osx arch=x86_64 --jobs=$(sysctl -n hw.logicalcpu)

The number of jobs finally makes my system sweet for about 10 minutes as it uses all 4 cores :-)

YASM

YASM is necessary for WebM SIMD optimizations.

The YASM warning is still there so how do we fix that?

So I did not do brew install scons yasm and installed scons

Random notes

Python 2.x

I did a long time ago brew install python@2 which errors with an error on hashlib

So removed that to get to MacOS default python version 2.7.16 which ran OK