Skip to content

Commit bec35ea

Browse files
Merge pull request #1317 from wordpress-mobile/issue/1313_carthage_build
Fix Carthage build for Xcode 12
2 parents d37c998 + cfb4bc8 commit bec35ea

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

Example/AztecExample.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@
614614
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
615615
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
616616
SWIFT_VERSION = 4.0;
617+
VALIDATE_WORKSPACE = YES;
617618
};
618619
name = Debug;
619620
};
@@ -667,6 +668,7 @@
667668
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
668669
SWIFT_VERSION = 4.0;
669670
VALIDATE_PRODUCT = YES;
671+
VALIDATE_WORKSPACE = YES;
670672
};
671673
name = Release;
672674
};
@@ -829,6 +831,7 @@
829831
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
830832
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
831833
SWIFT_VERSION = 4.0;
834+
VALIDATE_WORKSPACE = YES;
832835
};
833836
name = Profiling;
834837
};
@@ -912,6 +915,7 @@
912915
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
913916
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
914917
SWIFT_VERSION = 4.0;
918+
VALIDATE_WORKSPACE = YES;
915919
};
916920
name = "Release-Alpha";
917921
};

Example/carthage.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
# carthage.sh
4+
# Usage example: ./carthage.sh build --platform iOS
5+
# This script was copied from here: https://github.com/Carthage/Carthage/issues/3019#issuecomment-665136323
6+
7+
set -euo pipefail
8+
9+
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
10+
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
11+
12+
# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
13+
# the build will fail on lipo due to duplicate architectures.
14+
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
15+
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
16+
17+
export XCODE_XCCONFIG_FILE="$xcconfig"
18+
carthage "$@"

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ cd Example
3636
carthage update --platform iOS
3737
```
3838

39+
*If using XCode 12 use the follow script:*
40+
41+
```bash
42+
cd Example
43+
./carthage.sh update --platform iOS
44+
```
45+
3946
Once Carthage finishes, you should open the file `Aztec.xcworkspace` from the root directory of Aztec.
4047

4148
Make sure the `AztecExample` target it selected, and press CMD + R to run it.

0 commit comments

Comments
 (0)