diff options
author | George L. Albany <Megacake1234@gmail.com> | 2023-07-27 17:34:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-27 17:34:59 +0200 |
commit | debb71065c8947ee6d79c981eb43d631beb11294 (patch) | |
tree | 09cb0fa0a1dbe83d4833bcd62dc8832161e4329b /tools/macos_osxcross.py | |
parent | 65443efcc2f4c7d687b2bd9c631f6bb426688bbf (diff) | |
parent | be1d0545c2f7a85a63d05b4bdc1020ee284e72cb (diff) |
Merge pull request #2 from OpenVicProject/let-the-games-begin
Initial structural commit
Diffstat (limited to 'tools/macos_osxcross.py')
-rw-r--r-- | tools/macos_osxcross.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/macos_osxcross.py b/tools/macos_osxcross.py new file mode 100644 index 0000000..8ed9a5d --- /dev/null +++ b/tools/macos_osxcross.py @@ -0,0 +1,29 @@ +# Copied from https://github.com/godotengine/godot-cpp/blob/0ee980abae91c481009152cdccab8e61c9625303/tools/macos_osxcross.py +import os + + +def options(opts): + opts.Add("osxcross_sdk", "OSXCross SDK version", "darwin16") + + +def exists(env): + return "OSXCROSS_ROOT" in os.environ + + +def generate(env): + root = os.environ.get("OSXCROSS_ROOT", "") + if env["arch"] == "arm64": + basecmd = root + "/target/bin/arm64-apple-" + env["osxcross_sdk"] + "-" + else: + basecmd = root + "/target/bin/x86_64-apple-" + env["osxcross_sdk"] + "-" + + env["CC"] = basecmd + "clang" + env["CXX"] = basecmd + "clang++" + env["AR"] = basecmd + "ar" + env["RANLIB"] = basecmd + "ranlib" + env["AS"] = basecmd + "as" + + binpath = os.path.join(root, "target", "bin") + if binpath not in env["ENV"]["PATH"]: + # Add OSXCROSS bin folder to PATH (required for linking). + env["ENV"]["PATH"] = "%s:%s" % (binpath, env["ENV"]["PATH"]) |