Skip to content

Commit

Permalink
Update target configuration and module
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
surpher committed Apr 21, 2024
1 parent dc3f636 commit 0c05695
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Configurations/Project-Shared.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion Configurations/Target-iOS-Shared.xcconfig
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Configurations/Target-iOS-Tests-Shared.xcconfig
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Configurations/Target-iPhone-iOS-Shared.xcconfig
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions Configurations/Target-macOS-Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "Configurations/Target-macOS-Shared.xcconfig"

ONLY_ACTIVE_ARCH = YES

DEBUG_INFORMATION_FORMAT = dwarf
Expand Down
2 changes: 1 addition & 1 deletion Configurations/Target-macOS-Shared.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Configurations/Target-macOS-Tests-Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "Configurations/Target-macOS-Tests-Shared.xcconfig"

SWIFT_OPTIMIZATION_LEVEL = -O
ENABLE_NS_ASSERTIONS = NO
MTL_ENABLE_DEBUG_INFO = NO
Expand Down
3 changes: 2 additions & 1 deletion Configurations/Target-macOS-Tests-Shared.xcconfig
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions PactSwiftMockServer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -848,15 +848,13 @@
isa = XCBuildConfiguration;
baseConfigurationReference = ADBEF2F72648FB0600486C4A /* Target-macOS-Debug.xcconfig */;
buildSettings = {
MACOSX_DEPLOYMENT_TARGET = 12.0;
};
name = Debug;
};
AD15982B2648DF73007CFAA5 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = ADBEF2F32648FB0600486C4A /* Target-macOS-Release.xcconfig */;
buildSettings = {
MACOSX_DEPLOYMENT_TARGET = 12.0;
};
name = Release;
};
Expand Down
9 changes: 9 additions & 0 deletions Support/build_rust_dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c05695

Please sign in to comment.