[SCons] Build OpenSSL from source by default

Remove prebuilt static libraries for macOS.

Can optionally still use external (static) libraries by supplying the
`openssl_external_*` parameters to scons.
This commit is contained in:
Fabio Alessandrelli
2023-06-02 16:38:37 +02:00
committed by Rémi Verschelde
parent b8d79c3fc9
commit 955ec02503
11 changed files with 314 additions and 32 deletions

View File

@@ -14,16 +14,6 @@ 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.",
"libgit_plugin", PathVariable.PathAccept))
opts.Add(PathVariable("macos_openssl", "Path to OpenSSL library root - only used in macOS builds.",
"/usr/local/opt/openssl@1.1/", PathVariable.PathAccept)) # TODO: Find a way to configure this to use the cloned OpenSSL source code, based on `macos_arch`.
opts.Add(PathVariable("macos_openssl_static_ssl", "Path to OpenSSL libssl.a library - only used in macOS builds.",
os.path.join(os.path.abspath(os.getcwd()), "thirdparty/openssl/libssl.a"), PathVariable.PathAccept))
opts.Add(PathVariable("macos_openssl_static_crypto", "Path to OpenSSL libcrypto.a library - only used in macOS builds.",
os.path.join(os.path.abspath(os.getcwd()), "thirdparty/openssl/libcrypto.a"), PathVariable.PathAccept))
opts.Add(PathVariable("linux_openssl_static_ssl", "Path to OpenSSL libssl.a library - only used in Linux builds.",
"/usr/lib/x86_64-linux-gnu/libssl.a", PathVariable.PathAccept))
opts.Add(PathVariable("linux_openssl_static_crypto", "Path to OpenSSL libcrypto.a library - only used in Linux builds.",
"/usr/lib/x86_64-linux-gnu/libcrypto.a", PathVariable.PathAccept))
# Updates the environment with the option variables.
opts.Update(env)
@@ -33,8 +23,18 @@ if ARGUMENTS.get("custom_api_file", "") != "":
ARGUMENTS["target"] = "editor"
env = SConscript("godot-cpp/SConstruct").Clone()
# OpenSSL Builder
env.Tool("openssl", toolpath=["tools"])
opts.Update(env)
if env["platform"] != "windows": # Windows does not need OpenSSL
ssl = env.OpenSSL()
else:
ssl = []
Export("ssl")
Export("env")
SConscript("thirdparty/SCsub")