1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

[macOS] Add support for the Apple Silicon (ARM64) build target.

This commit is contained in:
bruvzg
2020-06-23 22:01:42 +03:00
parent 9fc65fd1f1
commit 00299f15b4
8 changed files with 52 additions and 14 deletions

View File

@@ -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"])