From 0c0569557a9a94ead4976765feb1d6db64762e6f Mon Sep 17 00:00:00 2001 From: Marko Justinek Date: Sun, 21 Apr 2024 12:50:03 +1000 Subject: [PATCH] Update target configuration and module Improving the build_rust_dependencies to set 'MACOSX_' and 'IPHONEOS_DEPLOYMENT_TARGET' when building libpact_ffi.a binaries. This removes the ld: warnings stating the binary was built for newer targets than being linked. --- Configurations/Project-Shared.xcconfig | 2 +- Configurations/Target-iOS-Shared.xcconfig | 5 ++++- Configurations/Target-iOS-Tests-Shared.xcconfig | 2 +- Configurations/Target-iPhone-iOS-Shared.xcconfig | 2 +- Configurations/Target-macOS-Debug.xcconfig | 1 + Configurations/Target-macOS-Shared.xcconfig | 2 +- Configurations/Target-macOS-Tests-Release.xcconfig | 1 + Configurations/Target-macOS-Tests-Shared.xcconfig | 3 ++- PactSwiftMockServer.xcodeproj/project.pbxproj | 2 -- Support/build_rust_dependencies | 9 +++++++++ 10 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Configurations/Project-Shared.xcconfig b/Configurations/Project-Shared.xcconfig index 0b43511..9c0dffa 100644 --- a/Configurations/Project-Shared.xcconfig +++ b/Configurations/Project-Shared.xcconfig @@ -4,7 +4,7 @@ MARKETING_VERSION = 0.4.4 CURRENT_PROJECT_VERSION = 1 VERSIONING_SYSTEM = apple-generic -SWIFT_VERSION = 5.0 +SWIFT_VERSION = 5.5 COPY_PHASE_STRIP = NO diff --git a/Configurations/Target-iOS-Shared.xcconfig b/Configurations/Target-iOS-Shared.xcconfig index d4978fd..c5e84bd 100644 --- a/Configurations/Target-iOS-Shared.xcconfig +++ b/Configurations/Target-iOS-Shared.xcconfig @@ -1,11 +1,14 @@ PRODUCT_NAME = PactSwiftMockServer -IPHONEOS_DEPLOYMENT_TARGET = 16.0 +IPHONEOS_DEPLOYMENT_TARGET = 13.0 SDKROOT = iphoneos INSTALL_PATH = $(LOCAL_LIBRARY_DIR)/Frameworks SKIP_INSTALL = YES TARGETED_DEVICE_FAMILY = 1,2 +SUPPORTED_PLATFORMS = iphoneos iphonesimulator SUPPORTS_MACCATALYST = NO +SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO +SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO BUNDLE_VERSION_STRING_SHORT = $(MARKETING_VERSION) DYLIB_COMPATIBILITY_VERSION = 1 diff --git a/Configurations/Target-iOS-Tests-Shared.xcconfig b/Configurations/Target-iOS-Tests-Shared.xcconfig index 6be7109..f50f4fa 100644 --- a/Configurations/Target-iOS-Tests-Shared.xcconfig +++ b/Configurations/Target-iOS-Tests-Shared.xcconfig @@ -1,7 +1,7 @@ SDKROOT = iphoneos PRODUCT_NAME = $(TARGET_NAME) TARGETED_DEVICE_FAMILY = 1,2 -IPHONEOS_DEPLOYMENT_TARGET = 16.0 +IPHONEOS_DEPLOYMENT_TARGET = 13.0 INFOPLIST_FILE = Configurations/Info-iOSTests.plist PRODUCT_BUNDLE_IDENTIFIER = au.com.pact-foundation.PactSwiftMockServerTests diff --git a/Configurations/Target-iPhone-iOS-Shared.xcconfig b/Configurations/Target-iPhone-iOS-Shared.xcconfig index e9650db..42311fd 100644 --- a/Configurations/Target-iPhone-iOS-Shared.xcconfig +++ b/Configurations/Target-iPhone-iOS-Shared.xcconfig @@ -1,6 +1,6 @@ PRODUCT_NAME = PactSwiftMockServer -IPHONEOS_DEPLOYMENT_TARGET = 16.0 +IPHONEOS_DEPLOYMENT_TARGET = 13.0 SDKROOT = iphoneos INSTALL_PATH = $(LOCAL_LIBRARY_DIR)/Frameworks SKIP_INSTALL = YES diff --git a/Configurations/Target-macOS-Debug.xcconfig b/Configurations/Target-macOS-Debug.xcconfig index 497d9b6..6948c9e 100644 --- a/Configurations/Target-macOS-Debug.xcconfig +++ b/Configurations/Target-macOS-Debug.xcconfig @@ -1,4 +1,5 @@ #include "Configurations/Target-macOS-Shared.xcconfig" + ONLY_ACTIVE_ARCH = YES DEBUG_INFORMATION_FORMAT = dwarf diff --git a/Configurations/Target-macOS-Shared.xcconfig b/Configurations/Target-macOS-Shared.xcconfig index de745bd..59b9c1e 100644 --- a/Configurations/Target-macOS-Shared.xcconfig +++ b/Configurations/Target-macOS-Shared.xcconfig @@ -3,7 +3,7 @@ PRODUCT_NAME = PactSwiftMockServer ONLY_ACTIVE_ARCH = NO SDKROOT = macosx -MACOSX_DEPLOYMENT_TARGET = 13.0 +MACOSX_DEPLOYMENT_TARGET = 12.0 CODE_SIGN_STYLE = Automatic DEFINES_MODULE = YES diff --git a/Configurations/Target-macOS-Tests-Release.xcconfig b/Configurations/Target-macOS-Tests-Release.xcconfig index e20b5cb..554c59a 100644 --- a/Configurations/Target-macOS-Tests-Release.xcconfig +++ b/Configurations/Target-macOS-Tests-Release.xcconfig @@ -1,4 +1,5 @@ #include "Configurations/Target-macOS-Tests-Shared.xcconfig" + SWIFT_OPTIMIZATION_LEVEL = -O ENABLE_NS_ASSERTIONS = NO MTL_ENABLE_DEBUG_INFO = NO diff --git a/Configurations/Target-macOS-Tests-Shared.xcconfig b/Configurations/Target-macOS-Tests-Shared.xcconfig index a1b61ea..aae5a3e 100644 --- a/Configurations/Target-macOS-Tests-Shared.xcconfig +++ b/Configurations/Target-macOS-Tests-Shared.xcconfig @@ -1,6 +1,7 @@ //:configuration = Debug + SDKROOT = macosx -MACOSX_DEPLOYMENT_TARGET = 13.0 +MACOSX_DEPLOYMENT_TARGET = 12.0 CODE_SIGN_STYLE = Automatic COMBINE_HIDPI_IMAGES = YES diff --git a/PactSwiftMockServer.xcodeproj/project.pbxproj b/PactSwiftMockServer.xcodeproj/project.pbxproj index e07b99d..2e8f1ca 100644 --- a/PactSwiftMockServer.xcodeproj/project.pbxproj +++ b/PactSwiftMockServer.xcodeproj/project.pbxproj @@ -848,7 +848,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = ADBEF2F72648FB0600486C4A /* Target-macOS-Debug.xcconfig */; buildSettings = { - MACOSX_DEPLOYMENT_TARGET = 12.0; }; name = Debug; }; @@ -856,7 +855,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = ADBEF2F32648FB0600486C4A /* Target-macOS-Release.xcconfig */; buildSettings = { - MACOSX_DEPLOYMENT_TARGET = 12.0; }; name = Release; }; diff --git a/Support/build_rust_dependencies b/Support/build_rust_dependencies index 18d5182..5ebef24 100755 --- a/Support/build_rust_dependencies +++ b/Support/build_rust_dependencies @@ -92,6 +92,15 @@ rustup component add rust-src --toolchain nightly-aarch64-apple-darwin # Build libpact_ffi binaries # ############################################## +# Set min deployment targets avoiding 'ld: warning's: +# avoiding "Object file (__/libpact_ffi.a[arm64][232](b0401a448be314bb-zdict.o)) was built for newer 'macOS' version (14.2) than being linked (12.0)" +unset MACOSX_DEPLOYMENT_TARGET +export MACOSX_DEPLOYMENT_TARGET=12.0 + +# avoiding "Object file (__/libpact_ffi.a[arm64][232](b0401a448be314bb-zdict.o)) was built for newer 'iOS-simulator' version (17.2) than being linked (13.0)" +unset IPHONEOS_DEPLOYMENT_TARGET +export IPHONEOS_DEPLOYMENT_TARGET=13.0 + echo "🏗 Building libpact_ffi.a for x86_64 iOS Simulator" echo "cargo build --target=x86_64-apple-ios --release" cargo build --target=x86_64-apple-ios --release