From 0df9163aae75880dee8df83f68498a35f525776e Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Thu, 17 Aug 2023 15:25:12 -0700 Subject: [PATCH] swift/build_ffi.sh: only set IPHONEOS_DEPLOYMENT_TARGET for iOS Otherwise, local builds on macOS hosts try to build some CMake-based dependencies for Catalyst. --- swift/build_ffi.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/swift/build_ffi.sh b/swift/build_ffi.sh index ff52f527..c98c4463 100755 --- a/swift/build_ffi.sh +++ b/swift/build_ffi.sh @@ -11,7 +11,6 @@ SCRIPT_DIR=$(dirname "$0") cd "${SCRIPT_DIR}"/.. . bin/build_helpers.sh -export IPHONEOS_DEPLOYMENT_TARGET=13 export CARGO_PROFILE_RELEASE_DEBUG=1 # enable line tables export CARGO_PROFILE_RELEASE_LTO=fat # use fat LTO to reduce binary size export CFLAGS="-DOPENSSL_SMALL ${CFLAGS:-}" # use small BoringSSL curve tables to reduce binary size @@ -20,6 +19,10 @@ export CFLAGS="-DOPENSSL_SMALL ${CFLAGS:-}" # use small BoringSSL curve tables t export CFLAGS_aarch64_apple_ios_macabi="--target=arm64-apple-ios-macabi ${CFLAGS}" export CFLAGS_x86_64_apple_ios_macabi="--target=x86_64-apple-ios-macabi ${CFLAGS}" +if [[ "${CARGO_BUILD_TARGET:-}" =~ -ios(-sim|-macabi)?$ ]]; then + export IPHONEOS_DEPLOYMENT_TARGET=13 +fi + usage() { cat >&2 <