aboutsummaryrefslogtreecommitdiff
path: root/tools/macos.py
diff options
context:
space:
mode:
author Spartan322 <Megacake1234@gmail.com>2023-09-23 01:58:11 +0200
committer Spartan322 <Megacake1234@gmail.com>2023-09-23 04:12:25 +0200
commit348668afee5bfbbc376d0615b51dca210213c1ec (patch)
tree6b3cbbc9f6d5e793d6c337023e95d94105ca888f /tools/macos.py
parent977661f6f4301be19fa64abfc6cda5040c3899b1 (diff)
Move actions and scripts to separate reusable repos
Diffstat (limited to 'tools/macos.py')
-rw-r--r--tools/macos.py51
1 files changed, 0 insertions, 51 deletions
diff --git a/tools/macos.py b/tools/macos.py
deleted file mode 100644
index f0fb81a..0000000
--- a/tools/macos.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copied from https://github.com/godotengine/godot-cpp/blob/2bf983e6382f5236948f7740faf130a3568f9dd0/tools/macos.py
-import os
-import sys
-import macos_osxcross
-
-
-def options(opts):
- opts.Add("macos_deployment_target", "macOS deployment target", "default")
- opts.Add("macos_sdk_path", "macOS SDK path", "")
- macos_osxcross.options(opts)
-
-
-def exists(env):
- return sys.platform == "darwin" or macos_osxcross.exists(env)
-
-
-def generate(env):
- if env["arch"] not in ("universal", "arm64", "x86_64"):
- print("Only universal, arm64, and x86_64 are supported on macOS. Exiting.")
- Exit()
-
- if sys.platform == "darwin":
- # Use clang on macOS by default
- env["CXX"] = "clang++"
- env["CC"] = "clang"
- else:
- # Use osxcross
- macos_osxcross.generate(env)
-
- if env["arch"] == "universal":
- env.Append(LINKFLAGS=["-arch", "x86_64", "-arch", "arm64"])
- env.Append(CCFLAGS=["-arch", "x86_64", "-arch", "arm64"])
- else:
- env.Append(LINKFLAGS=["-arch", env["arch"]])
- env.Append(CCFLAGS=["-arch", env["arch"]])
-
- if env["macos_deployment_target"] != "default":
- env.Append(CCFLAGS=["-mmacosx-version-min=" + env["macos_deployment_target"]])
- env.Append(LINKFLAGS=["-mmacosx-version-min=" + env["macos_deployment_target"]])
-
- if env["macos_sdk_path"]:
- env.Append(CCFLAGS=["-isysroot", env["macos_sdk_path"]])
- env.Append(LINKFLAGS=["-isysroot", env["macos_sdk_path"]])
-
- env.Append(
- LINKFLAGS=[
- "-framework",
- "Cocoa",
- "-Wl,-undefined,dynamic_lookup",
- ]
- )