mirror of
https://github.com/godotengine/godot-git-plugin.git
synced 2026-01-07 06:10:00 +03:00
Build universal OpenSSL fat library
This commit is contained in:
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@@ -49,8 +49,10 @@ jobs:
|
||||
- name: build-macos-release-x64
|
||||
run: |
|
||||
git submodule update --init --recursive
|
||||
brew install scons openssl@1.1
|
||||
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=x86_64 use_llvm=yes -j $(sysctl -n hw.logicalcpu)
|
||||
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)
|
||||
otool -L demo/addons/godot-git-plugin/osx/libgitapi.dylib
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
@@ -58,3 +60,5 @@ jobs:
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
demo/
|
||||
libssl.a
|
||||
libcrypto.a
|
||||
|
||||
20
build_openssl_arm64_osx.sh
Normal file
20
build_openssl_arm64_osx.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
OPENSSL_VERSION="1.1.1i"
|
||||
|
||||
curl -OL http://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
|
||||
tar -xzvf openssl-$OPENSSL_VERSION.tar.gz
|
||||
mv openssl-$OPENSSL_VERSION openssl_arm64
|
||||
tar -xzvf openssl-$OPENSSL_VERSION.tar.gz
|
||||
mv openssl-$OPENSSL_VERSION openssl_x86_64
|
||||
cd openssl_arm64
|
||||
./Configure darwin64-arm64-cc
|
||||
make
|
||||
cd ../
|
||||
cd openssl_x86_64
|
||||
./Configure darwin64-x86_64-cc
|
||||
make
|
||||
cd ../
|
||||
lipo -create openssl_arm64/libcrypto.a openssl_x86_64/libcrypto.a -output libcrypto.a
|
||||
lipo -create openssl_arm64/libssl.a openssl_x86_64/libssl.a -output libssl.a
|
||||
rm openssl-$OPENSSL_VERSION.tar.gz
|
||||
@@ -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)
|
||||
|
||||
12
thirdparty/ssh2/SCsub
vendored
12
thirdparty/ssh2/SCsub
vendored
@@ -106,16 +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])
|
||||
|
||||
# TODO: Verify if this works on actual M1 hardware
|
||||
if env_ssh2["macos_arch"] == "arm64":
|
||||
env_ssh2.Append(
|
||||
CPPDEFINES=[
|
||||
("WORDS_BIGENDIAN", "1"),
|
||||
# ("AC_APPLE_UNIVERSAL_BUILD", "1")
|
||||
])
|
||||
|
||||
env_ssh2.StaticLibrary(target="../bin/" + "ssh2", source=libssh2_sources)
|
||||
|
||||
Reference in New Issue
Block a user