Skip to content

Commit

Permalink
Xcode 12 fix to skip simulator arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
nonelse authored and uerceg committed Dec 9, 2020
1 parent 3cead1c commit 7bb9b5a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Adjust.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2895,6 +2895,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
Expand All @@ -2914,6 +2915,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
Expand Down Expand Up @@ -3032,6 +3034,7 @@
DEAD_CODE_STRIPPING = NO;
DSTROOT = /tmp/Adjust.dst;
ENABLE_BITCODE = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
Expand All @@ -3056,6 +3059,7 @@
DEAD_CODE_STRIPPING = NO;
DSTROOT = /tmp/Adjust.dst;
ENABLE_BITCODE = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = QGUGW9AUMK;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -499,6 +500,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = QGUGW9AUMK;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
9 changes: 6 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ echo -e "${CYAN}[ADJUST][BUILD]:${GREEN} Done! ${NC}"
# ======================================== #

echo -e "${CYAN}[ADJUST][BUILD]:${GREEN} Bulding dynamic iOS and tvOS targets with Carthage ... ${NC}"
carthage build --no-skip-current
#carthage build --no-skip-current
./scripts/carthage_xcode12.sh build --no-skip-current
echo -e "${CYAN}[ADJUST][BUILD]:${GREEN} Done! ${NC}"

# ======================================== #
Expand All @@ -86,7 +87,8 @@ echo -e "${CYAN}[ADJUST][BUILD]:${GREEN} Done! ${NC}"
# ======================================== #

echo -e "${CYAN}[ADJUST][BUILD]:${GREEN} Bulding dynamic iMessage target with Carthage ... ${NC}"
carthage build --no-skip-current
#carthage build --no-skip-current
./scripts/carthage_xcode12.sh build --no-skip-current
echo -e "${CYAN}[ADJUST][BUILD]:${GREEN} Done! ${NC}"

# ======================================== #
Expand All @@ -105,7 +107,8 @@ echo -e "${CYAN}[ADJUST][BUILD]:${GREEN} Done! ${NC}"
# ======================================== #

echo -e "${CYAN}[ADJUST][BUILD]:${GREEN} Bulding dynamic WebBridge target with Carthage ... ${NC}"
carthage build --no-skip-current
#carthage build --no-skip-current
./scripts/carthage_xcode12.sh build --no-skip-current
echo -e "${CYAN}[ADJUST][BUILD]:${GREEN} Done! ${NC}"

# ======================================== #
Expand Down
20 changes: 20 additions & 0 deletions scripts/carthage_xcode12.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# carthage.sh
# Usage example: ./carthage.sh build --platform iOS

set -euo pipefail

xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT

# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.

CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3)
echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$CURRENT_XCODE_VERSION = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig

echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))' >> $xcconfig
echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig

export XCODE_XCCONFIG_FILE="$xcconfig"
carthage "$@"

1 comment on commit 7bb9b5a

@ringoz
Copy link

@ringoz ringoz commented on 7bb9b5a Jul 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this exclusion of arm64 for iphonesimulator target is still necessary?
it breaks my app's ability to run on M1 iOS Simulator

Please sign in to comment.