Skip to content

Commit e131fff

Browse files
futuunfacebook-github-bot
authored andcommitted
fix undefined_arch error in Xcode 10 beta (#19841)
Summary: Fixes #19774 I spotted that in Xcode 10 beta `CURRENT_ARCH` is set to string `undefined_arch`. This PR will add fallback based on platform name (simulators are `x86_64` and everything since iPhone 5s is `arm64`). Closes #19841 Differential Revision: D8619897 Pulled By: hramos fbshipit-source-id: ed2ebaca105c6dcb40099f1a4aebe34d0660130c
1 parent 3cd0737 commit e131fff

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

scripts/ios-configure-glog.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@
22
set -e
33

44
PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
5-
CURRENT_ARCH="${CURRENT_ARCH:-armv7}"
5+
CURRENT_ARCH="${CURRENT_ARCH}"
6+
7+
if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then
8+
# Xcode 10 beta sets CURRENT_ARCH to "undefined_arch", this leads to incorrect linker arg.
9+
# it's better to rely on platform name as fallback because architecture differs between simulator and device
10+
11+
if [[ "$PLATFORM_NAME" == *"simulator"* ]]; then
12+
CURRENT_ARCH="x86_64"
13+
else
14+
CURRENT_ARCH="armv7"
15+
fi
16+
fi
617

718
export CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)"
819
export CXX="$CC"

0 commit comments

Comments
 (0)