From 7cb6d6c8467a8b59837edd93f1f16ea6abd7f9a8 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Fri, 9 Jul 2021 17:21:58 +0200 Subject: Add OSX arm64 build. Needs a more recent revision of godot-cpp, but can still use godot-headers from 3.2 . See CI script update for details. --- SConstruct | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index b6f1603..4fbe324 100644 --- a/SConstruct +++ b/SConstruct @@ -70,6 +70,8 @@ opts.Add( "Path to iPhone toolchain", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain", ) +opts.Add("macos_sdk_path", "macOS SDK path", "") +opts.Add(EnumVariable("macos_arch", "Target macOS architecture", "x86_64", ["x86_64", "arm64"])) # Update environment (parse options) opts.Update(env) @@ -149,9 +151,15 @@ elif target_platform == "osx": # Only 64-bits is supported for OS X target_arch = "64" + if env["macos_arch"] != "x86_64": + target_arch = "arm64" - env.Append(CCFLAGS=["-std=c++14", "-arch", "x86_64"]) - env.Append(LINKFLAGS=["-arch", "x86_64", "-framework", "Cocoa", "-Wl,-undefined,dynamic_lookup"]) + env.Append(CCFLAGS=["-std=c++14", "-arch", env["macos_arch"]]) + env.Append(LINKFLAGS=["-arch", env["macos_arch"], "-framework", "Cocoa", "-Wl,-undefined,dynamic_lookup"]) + + if env["macos_sdk_path"]: + env.Append(CCFLAGS=["-isysroot", env["macos_sdk_path"]]) + env.Append(LINKFLAGS=["-isysroot", env["macos_sdk_path"]]) if env["target"] == "debug": env.Append(CCFLAGS=["-Og", "-g"]) -- cgit v1.2.3