diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-07-01 16:45:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-01 16:45:23 +0200 |
commit | 5c9ee93f3e6918974aa5dc7dab65a2fdbc8c3313 (patch) | |
tree | 9b2252be5843b7ce4efbb4ed570abcf8557c38fe /platform/osx/detect.py | |
parent | 01559ca84e0782b91788be73609f2c8afed94027 (diff) | |
parent | 00299f15b46b695d6809f7f812daaad1ad520b4a (diff) | |
download | redot-engine-5c9ee93f3e6918974aa5dc7dab65a2fdbc8c3313.tar.gz |
Merge pull request #39788 from bruvzg/macos_apple_silicon
[macOS] Add support for the Apple Silicon (ARM64) build target.
Diffstat (limited to 'platform/osx/detect.py')
-rw-r--r-- | platform/osx/detect.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 29aa8ece19..ff4c024551 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -87,8 +87,15 @@ def configure(env): env["osxcross"] = True if not "osxcross" in env: # regular native build - env.Append(CCFLAGS=["-arch", "x86_64"]) - env.Append(LINKFLAGS=["-arch", "x86_64"]) + if env["arch"] == "arm64": + print("Building for macOS 10.15+, platform arm64.") + env.Append(CCFLAGS=["-arch", "arm64", "-mmacosx-version-min=10.15", "-target", "arm64-apple-macos10.15"]) + env.Append(LINKFLAGS=["-arch", "arm64", "-mmacosx-version-min=10.15", "-target", "arm64-apple-macos10.15"]) + else: + print("Building for macOS 10.12+, platform x86-64.") + env.Append(CCFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"]) + env.Append(LINKFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"]) + if env["macports_clang"] != "no": mpprefix = os.environ.get("MACPORTS_PREFIX", "/opt/local") mpclangver = env["macports_clang"] @@ -148,7 +155,8 @@ def configure(env): ## Dependencies if env["builtin_libtheora"]: - env["x86_libtheora_opt_gcc"] = True + if env["arch"] != "arm64": + env["x86_libtheora_opt_gcc"] = True ## Flags @@ -189,6 +197,3 @@ def configure(env): env.Append(LIBS=["vulkan"]) # env.Append(CPPDEFINES=['GLES_ENABLED', 'OPENGL_ENABLED']) - - env.Append(CCFLAGS=["-mmacosx-version-min=10.12"]) - env.Append(LINKFLAGS=["-mmacosx-version-min=10.12"]) |