Skip to content

Commit

Permalink
misc/ios: pick clang arch based on GOARCH
Browse files Browse the repository at this point in the history
Change-Id: Ia49ab729747acb07bf392d90aea9e752471e152e
Reviewed-on: https://go-review.googlesource.com/8789
Reviewed-by: Minux Ma <[email protected]>
  • Loading branch information
crawshaw committed Apr 12, 2015
1 parent 75c0566 commit 684473d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion misc/ios/clangwrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,14 @@ SDK_PATH=`xcrun --sdk $SDK --show-sdk-path`
export IPHONEOS_DEPLOYMENT_TARGET=5.1
# cmd/cgo doesn't support llvm-gcc-4.2, so we have to use clang.
CLANG=`xcrun --sdk $SDK --find clang`
exec $CLANG -arch armv7 -isysroot $SDK_PATH "$@"

if [ "$GOARCH" == "arm" ]; then
CLANGARCH="armv7"
elif [ "$GOARCH" == "arm64" ]; then
CLANGARCH="arm64"
else
echo "unknown GOARCH=$GOARCH" >&2
exit 1
fi

exec $CLANG -arch $CLANGARCH -isysroot $SDK_PATH "$@"

0 comments on commit 684473d

Please sign in to comment.