mirror of
https://github.com/godotengine/godot-git-plugin.git
synced 2026-01-01 01:48:28 +03:00
Add universal OpenSSL library builds
This commit is contained in:
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -49,10 +49,8 @@ jobs:
|
||||
- name: build-macos-release-x64
|
||||
run: |
|
||||
git submodule update --init --recursive
|
||||
chmod +x build_openssl_arm64_osx.sh
|
||||
./build_openssl_arm64_osx.sh
|
||||
brew install scons
|
||||
scons platform=osx target=release bits=64 godot_cpp=yes generate_bindings=yes use_custom_api_file=yes custom_api_file=api.ci.json macos_arch=universal macos_openssl_static_ssl="libssl.a" macos_openssl_static_crypto="libcrypto.a" use_llvm=yes -j $(sysctl -n hw.logicalcpu)
|
||||
scons platform=osx target=release bits=64 godot_cpp=yes generate_bindings=yes use_custom_api_file=yes custom_api_file=api.ci.json macos_arch=universal use_llvm=yes -j $(sysctl -n hw.logicalcpu)
|
||||
otool -L demo/addons/godot-git-plugin/osx/libgitapi.dylib
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -24,3 +24,4 @@ win64/
|
||||
*.obj
|
||||
*.ilk
|
||||
*.pdb
|
||||
!thirdparty/openssl/*
|
||||
|
||||
@@ -19,8 +19,13 @@ This section onwards is only meant to be used if you intend to compile the plugi
|
||||
|
||||
- [SCons](https://scons.org/pages/download.html) (v3.0.1+)
|
||||
- C++17 and C90 compilers detectable by SCons and present in `PATH`.
|
||||
- For Mac users, run `brew install openssl@1.1`.
|
||||
- For Linux users, `sudo apt-get install libssl-dev`, or local package manager equivalent.
|
||||
- Platforms Specific Setup
|
||||
- Windows
|
||||
- No extra steps required other than setting up the compilers.
|
||||
- MacOS
|
||||
- For making universal builds targeting both Apple Silicon and x86_64, you can optionally run `build_openssl_universal_osx.sh` to build OpenSSL yourself and replace the already prebuilt libraries provided inside `thirdparty/openssl/`, otherwise, just run `brew install openssl@1.1`.
|
||||
- Linux
|
||||
- Run `sudo apt-get install libssl-dev`, or local package manager equivalent.
|
||||
|
||||
### Build
|
||||
|
||||
|
||||
@@ -27,12 +27,12 @@ opts.Add(PathVariable("target_name", "The library name.",
|
||||
opts.Add(EnumVariable("bits", "The bit architecture.", "64", ["64"]))
|
||||
opts.Add(EnumVariable("macos_arch", "Target macOS architecture",
|
||||
"universal", ["universal", "x86_64", "arm64"]))
|
||||
opts.Add(PathVariable("macos_openssl", "Path to OpenSSL libraries - only used in macOS builds.",
|
||||
"/usr/local/opt/openssl@1.1/", 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.",
|
||||
"/usr/local/opt/openssl@1.1/lib/libssl.a", PathVariable.PathAccept))
|
||||
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.",
|
||||
"/usr/local/opt/openssl@1.1/lib/libcrypto.a", PathVariable.PathAccept))
|
||||
os.path.join(os.path.abspath(os.getcwd()), "thirdparty/openssl/libcrypto.a"), PathVariable.PathAccept))
|
||||
|
||||
# Updates the environment with the option variables.
|
||||
opts.Update(env)
|
||||
|
||||
@@ -33,8 +33,8 @@ if env["platform"] == "osx":
|
||||
cpp_library += ".osx"
|
||||
|
||||
# Force static linkage (https://stackoverflow.com/a/2995999/7370948)
|
||||
static_ssl = File("../" + env["macos_openssl_static_ssl"])
|
||||
static_crypto = File("../" + env["macos_openssl_static_crypto"])
|
||||
static_ssl = File(env["macos_openssl_static_ssl"])
|
||||
static_crypto = File(env["macos_openssl_static_crypto"])
|
||||
env.Append(LIBS=[static_ssl, static_crypto])
|
||||
|
||||
if env["target"] in ("debug", "d"):
|
||||
|
||||
4
thirdparty/git2/SCsub
vendored
4
thirdparty/git2/SCsub
vendored
@@ -128,8 +128,8 @@ if env_git["platform"] in ["linux", "osx"]:
|
||||
|
||||
if env_git["platform"] == "osx":
|
||||
env_git.Prepend(CPPPATH=[env_git["macos_openssl"] + "include/"])
|
||||
static_ssl = File("../../" + env_git["macos_openssl_static_ssl"])
|
||||
static_crypto = File("../../" + env_git["macos_openssl_static_crypto"])
|
||||
static_ssl = File(env_git["macos_openssl_static_ssl"])
|
||||
static_crypto = File(env_git["macos_openssl_static_crypto"])
|
||||
env_git.Append(LIBS=[static_ssl, static_crypto])
|
||||
|
||||
env_git.StaticLibrary(target="../bin/" + "git2", source=libgit2_sources)
|
||||
|
||||
BIN
thirdparty/openssl/libcrypto.a
vendored
Normal file
BIN
thirdparty/openssl/libcrypto.a
vendored
Normal file
Binary file not shown.
BIN
thirdparty/openssl/libssl.a
vendored
Normal file
BIN
thirdparty/openssl/libssl.a
vendored
Normal file
Binary file not shown.
4
thirdparty/ssh2/SCsub
vendored
4
thirdparty/ssh2/SCsub
vendored
@@ -106,8 +106,8 @@ if env_ssh2["platform"] in ["linux", "osx"]:
|
||||
|
||||
if env_ssh2["platform"] == "osx":
|
||||
env_ssh2.Append(CPPPATH=[env_ssh2["macos_openssl"] + "include/"])
|
||||
static_ssl = File("../../" + env_ssh2["macos_openssl_static_ssl"])
|
||||
static_crypto = File("../../" + env_ssh2["macos_openssl_static_crypto"])
|
||||
static_ssl = File(env_ssh2["macos_openssl_static_ssl"])
|
||||
static_crypto = File(env_ssh2["macos_openssl_static_crypto"])
|
||||
env_ssh2.Append(LIBS=[static_ssl, static_crypto])
|
||||
|
||||
env_ssh2.StaticLibrary(target="../bin/" + "ssh2", source=libssh2_sources)
|
||||
|
||||
Reference in New Issue
Block a user