diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-07-09 17:21:58 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-07-11 10:01:55 +0200 |
commit | 7cb6d6c8467a8b59837edd93f1f16ea6abd7f9a8 (patch) | |
tree | 476ce46bcad50747d081b4b85d97d83389a8dca6 /SConstruct | |
parent | c0b31562f51606fc1b1c662e99dffde1044a9583 (diff) | |
download | fork-godot-webrtc-native-7cb6d6c8467a8b59837edd93f1f16ea6abd7f9a8.tar.gz fork-godot-webrtc-native-7cb6d6c8467a8b59837edd93f1f16ea6abd7f9a8.tar.bz2 fork-godot-webrtc-native-7cb6d6c8467a8b59837edd93f1f16ea6abd7f9a8.zip |
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.
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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"]) |