summaryrefslogtreecommitdiff
path: root/platform/osx/detect.py
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2020-06-23 22:01:42 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2020-06-29 12:33:51 +0300
commit00299f15b46b695d6809f7f812daaad1ad520b4a (patch)
tree527781843f15ef421089ca02b119583d9e8e815e /platform/osx/detect.py
parent9fc65fd1f15b2ae2e26cf69c54819e7d6598fa05 (diff)
[macOS] Add support for the Apple Silicon (ARM64) build target.
Diffstat (limited to 'platform/osx/detect.py')
-rw-r--r--platform/osx/detect.py17
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"])