Skip to content

Commit 386c424

Browse files
Merge pull request #338 from pusher/docs/xcode-12-carthage-tips-for-readme
Additions to README for Carthage integration when using Xcode 12.0 and above
2 parents 874e401 + 6f334eb commit 386c424

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Consumption-Tests/Shared/carthage.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
1010

1111
# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
1212
# the build will fail on lipo due to duplicate architectures.
13-
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
13+
14+
CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3)
15+
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
16+
17+
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
1418
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
1519

1620
export XCODE_XCCONFIG_FILE="$xcconfig"

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ Carthage will produce a number of frameworks. You need to include the following
122122

123123
#### Xcode 12 considerations
124124

125-
Using Carthage under Xcode 12.0 and above currently requires [a workaround](https://github.com/Carthage/Carthage/issues/3019) in order for the build to be successful. You can find an example of the workaround, which is used for running the 'Consumption-Tests' [here](Consumption-Tests/Shared/carthage.sh).
125+
There have been changes to the architectures included when building universal frameworks under Xcode 12.0 and above. This is to support the introduction of the Apple Silicon family of processors.
126+
127+
It is strongly recommended that you integrate PusherSwift using the `--use-xcframeworks` flag, running Carthage `0.37.0` or above. There are [full instructions](https://github.com/Carthage/Carthage#building-platform-independent-xcframeworks-xcode-12-and-above) for this (as well as instructions for [migrating to XCFrameworks](https://github.com/Carthage/Carthage#migrating-a-project-from-framework-bundles-to-xcframeworks) if you are already integrating using Carthage).
128+
129+
Alternatively, if you are building using an Intel Mac and do not want to migrate to build Carthage dependencies using XCFrameworks there is [a workaround](https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md) to build successfully. You can find an example of this workaround, which is used for running the 'Consumption-Tests' [here](Consumption-Tests/Shared/carthage.sh).
126130

127131
### Swift Package Manager
128132

0 commit comments

Comments
 (0)