Add links flags for linking to ssl on macOS + python cleanup

This commit is contained in:
Twarit Waikar
2021-10-12 22:11:41 +05:30
parent 14100de179
commit 8d21ddc183
4 changed files with 67 additions and 57 deletions

View File

@@ -7,42 +7,50 @@ EnsurePythonVersion(3, 5)
opts = Variables([], ARGUMENTS)
env = Environment(ENV = os.environ)
env = Environment(ENV=os.environ)
# Define our options
opts.Add(EnumVariable("target", "Compilation target", "debug", ["d", "debug", "r", "release"]))
opts.Add(EnumVariable("platform", "Compilation platform", "", ["", "windows", "linux", "osx"]))
opts.Add(EnumVariable("p", "Compilation target, alias for \"platform\"", "", ["", "windows", "linux", "osx"]))
opts.Add(BoolVariable("godot_cpp", "Build godot-cpp by forwarding arguments to it.", "no"))
opts.Add(BoolVariable("use_llvm", "Use the LLVM / Clang compiler - only effective when targeting Linux or FreeBSD.", "no"))
opts.Add(PathVariable("target_path", "The path where the lib is installed.", "demo/addons/godot-git-plugin/"))
opts.Add(PathVariable("target_name", "The library name.", "libgitapi", PathVariable.PathAccept))
opts.Add(EnumVariable("target", "Compilation target",
"debug", ["d", "debug", "r", "release"]))
opts.Add(EnumVariable("platform", "Compilation platform",
"", ["", "windows", "linux", "osx"]))
opts.Add(EnumVariable("p", "Compilation target, alias for \"platform\"",
"", ["", "windows", "linux", "osx"]))
opts.Add(BoolVariable(
"godot_cpp", "Build godot-cpp by forwarding arguments to it.", "no"))
opts.Add(BoolVariable("use_llvm",
"Use the LLVM / Clang compiler - only effective when targeting Linux or FreeBSD.", "no"))
opts.Add(PathVariable("target_path",
"The path where the lib is installed.", "demo/addons/godot-git-plugin/"))
opts.Add(PathVariable("target_name", "The library name.",
"libgitapi", PathVariable.PathAccept))
opts.Add(EnumVariable("bits", "The bit architecture.", "64", ["64"]))
opts.Add(EnumVariable("macos_arch", "Target macOS architecture", "universal", ["universal", "x86_64", "arm64"]))
opts.Add(EnumVariable("macos_arch", "Target macOS architecture",
"universal", ["universal", "x86_64", "arm64"]))
# Updates the environment with the option variables.
opts.Update(env)
if env["platform"] == "osx":
# Use only clang on osx because we need to do universal builds
env["CXX"] = "clang++"
env["CC"] = "clang"
# Use only clang on osx because we need to do universal builds
env["CXX"] = "clang++"
env["CC"] = "clang"
if env["macos_arch"] == "universal":
env.Append(LINKFLAGS=["-arch", "x86_64", "-arch", "arm64"])
env.Append(CCFLAGS=["-arch", "x86_64", "-arch", "arm64"])
else:
env.Append(LINKFLAGS=["-arch", env["macos_arch"]])
env.Append(CCFLAGS=["-arch", env["macos_arch"]])
if env["macos_arch"] == "universal":
env.Append(LINKFLAGS=["-arch", "x86_64", "-arch", "arm64"])
env.Append(CCFLAGS=["-arch", "x86_64", "-arch", "arm64"])
else:
env.Append(LINKFLAGS=["-arch", env["macos_arch"]])
env.Append(CCFLAGS=["-arch", env["macos_arch"]])
Export("env")
SConscript("thirdparty/SCsub")
if env["godot_cpp"]:
if ARGUMENTS.get("use_custom_api_file", False) and ARGUMENTS.get("custom_api_file", "") != "":
ARGUMENTS["custom_api_file"] = "../" + ARGUMENTS["custom_api_file"]
if ARGUMENTS.get("use_custom_api_file", False) and ARGUMENTS.get("custom_api_file", "") != "":
ARGUMENTS["custom_api_file"] = "../" + ARGUMENTS["custom_api_file"]
SConscript("godot-cpp/SConstruct")
SConscript("godot-cpp/SConstruct")
SConscript("godot-git-plugin/SCsub")