mirror of
https://github.com/godotengine/godot-git-plugin.git
synced 2026-01-01 01:48:28 +03:00
Add universal builds back to CI + link to OpenSSL dylib, not .a
This commit is contained in:
23
.github/workflows/build.yml
vendored
23
.github/workflows/build.yml
vendored
@@ -42,7 +42,7 @@ jobs:
|
||||
path: |
|
||||
demo/
|
||||
|
||||
macos:
|
||||
macos-x64:
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -50,11 +50,28 @@ jobs:
|
||||
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)
|
||||
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 macos_ssl_path=/usr/local/opt/openssl@1.1/ use_llvm=yes -j $(sysctl -n hw.logicalcpu)
|
||||
otool -L demo/addons/godot-git-plugin/osx/libgitapi.dylib
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: godot-git-plugin-macos-release-${{ github.sha }}
|
||||
name: godot-git-plugin-macos-release-x64-${{ github.sha }}
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
demo/
|
||||
|
||||
macos-arm64:
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: build-macos-release
|
||||
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=arm64 macos_ssl_path=/usr/local/opt/openssl@1.1/ use_llvm=yes -j $(sysctl -n hw.logicalcpu)
|
||||
otool -L demo/addons/godot-git-plugin/osx/libgitapi.dylib
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: godot-git-plugin-macos-release-arm64-${{ github.sha }}
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
demo/
|
||||
|
||||
2
.github/workflows/clang-format.yml
vendored
2
.github/workflows/clang-format.yml
vendored
@@ -1,6 +1,6 @@
|
||||
name: clang-format
|
||||
|
||||
on: [push]
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
clang-format:
|
||||
|
||||
@@ -19,7 +19,7 @@ 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, `brew install openssl@1.1`
|
||||
- For Mac users, run `brew install openssl` and use the `macos_ssl_path` SCons argument.
|
||||
- For Linux users, `sudo apt-get install libssl-dev`, or local package manager equivalent.
|
||||
|
||||
### Build
|
||||
|
||||
@@ -27,6 +27,8 @@ 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_ssl_path", "Path to OpenSSL libraries - only used in macOS builds.",
|
||||
"/usr/local/opt/openssl/", PathVariable.PathAccept))
|
||||
# Updates the environment with the option variables.
|
||||
opts.Update(env)
|
||||
|
||||
|
||||
@@ -32,9 +32,6 @@ if env["platform"] == "osx":
|
||||
env["target_path"] += "osx/"
|
||||
cpp_library += ".osx"
|
||||
|
||||
env.Prepend(LIBPATH=["/usr/local/opt/openssl@1.1/lib/"])
|
||||
env.Append(LIBS=["ssl", "crypto"])
|
||||
|
||||
if env["target"] in ("debug", "d"):
|
||||
env.Append(CCFLAGS=["-g", "-O2", "-std=c++17"])
|
||||
else:
|
||||
|
||||
9
thirdparty/git2/SCsub
vendored
9
thirdparty/git2/SCsub
vendored
@@ -131,6 +131,13 @@ if env_git["platform"] in ["linux", "osx"]:
|
||||
)
|
||||
|
||||
if env_git["platform"] == "osx":
|
||||
env_git.Prepend(CPPPATH=["/usr/local/opt/openssl@1.1/include/"])
|
||||
# We link to OpenSSL dynamically only on macOS to allow universal builds
|
||||
env_git.Prepend(
|
||||
CPPDEFINES=[
|
||||
"CRYPT_OPENSSL_DYNAMIC",
|
||||
("GIT_OPENSSL_DYNAMIC", "1"),
|
||||
]
|
||||
)
|
||||
env_git.Prepend(CPPPATH=[env_git["macos_ssl_path"] + "include/"])
|
||||
|
||||
env_git.StaticLibrary(target="../bin/" + "git2", source=libgit2_sources)
|
||||
|
||||
9
thirdparty/ssh2/SCsub
vendored
9
thirdparty/ssh2/SCsub
vendored
@@ -105,12 +105,17 @@ if env_ssh2["platform"] in ["linux", "osx"]:
|
||||
)
|
||||
|
||||
if env_ssh2["platform"] == "osx":
|
||||
env_ssh2.Append(CPPPATH=[env_ssh2["macos_ssl_path"] + "include/"])
|
||||
|
||||
# We only link to OpenSSL dynamic libraries on macOS when we are
|
||||
# doing a universal build, otherwise we do a static link
|
||||
if env_ssh2["macos_arch"] == "universal":
|
||||
env_ssh2.Append(CPPDEFINES=[
|
||||
("WORDS_BIGENDIAN", "1"),
|
||||
("AC_APPLE_UNIVERSAL_BUILD", 1)
|
||||
])
|
||||
env_ssh2.Append(CPPPATH=["/usr/local/opt/openssl@1.1/include/"])
|
||||
env_ssh2.Append(LIBPATH=["/usr/local/opt/openssl@1.1/lib/"])
|
||||
else:
|
||||
env_ssh2.Append(LIBPATH=[env_ssh2["macos_ssl_path"] + "lib/"])
|
||||
env_ssh2.Append(LIBS=["ssl", "crypto"])
|
||||
|
||||
env_ssh2.StaticLibrary(target="../bin/" + "ssh2", source=libssh2_sources)
|
||||
|
||||
Reference in New Issue
Block a user