Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SCons] Improve CMake and OpenSSL macOS/iOS targets #148

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ jobs:
arch: 'x86_64'
gdnative_flags: 'ios_arch=x86_64'
sconsflags: 'ios_simulator=true'
os: 'macos-11'
os: 'macos-12'
cache-name: ios-x86_64-simulator
- platform: ios
arch: 'arm64'
gdnative_flags: 'ios_arch=arm64'
sconsflags: ''
os: 'macos-11'
os: 'macos-12'
cache-name: ios-arm64

# Linux
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
arch: 'universal'
gdnative_flags: 'macos_arch=universal bits=64'
sconsflags: ''
os: 'macos-11'
os: 'macos-12'
cache-name: macos-universal

# Windows
Expand Down
5 changes: 2 additions & 3 deletions tools/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ def cmake_default_flags(env):
config["CMAKE_OSX_ARCHITECTURES"] = '"x86_64;arm64"'
else:
config["CMAKE_OSX_ARCHITECTURES"] = env["arch"]
if env["macos_deployment_target"] != "default":
if env.get("macos_deployment_target", "default") != "default":
config["CMAKE_OSX_DEPLOYMENT_TARGET"] = env["macos_deployment_target"]

if env["platform"] == "macos" and sys.platform != "darwin" and "OSXCROSS_ROOT" in os.environ:
if sys.platform != "darwin" and "OSXCROSS_ROOT" in os.environ:
config["CMAKE_AR"] = env["AR"]
config["CMAKE_RANLIB"] = env["RANLIB"]
if env["arch"] == "universal":
Expand Down
8 changes: 8 additions & 0 deletions tools/openssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ def ssl_platform_flags(env):
if env.get("android_api_level", ""):
api = int(env["android_api_level"])
args.append("-D__ANDROID_API__=%s" % api)
elif env["platform"] == "ios":
if env.get("ios_min_version", "default") != "default":
if env.get("ios_simulator", False):
args.append("-mios-simulator-version-min=%s" % env["ios_min_version"])
else:
args.append("-miphoneos-version-min=%s" % env["ios_min_version"])
elif env["platform"] == "macos":
if env.get("macos_deployment_target", "default") != "default":
args.append("-mmacosx-version-min=%s" % env["macos_deployment_target"])
# OSXCross toolchain setup.
if sys.platform != "darwin" and "OSXCROSS_ROOT" in os.environ:
for k in ["CC", "CXX", "AR", "AS", "RANLIB"]:
Expand Down