diff options
Diffstat (limited to 'misc/ios/clangwrap.sh')
-rwxr-xr-x | misc/ios/clangwrap.sh | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/misc/ios/clangwrap.sh b/misc/ios/clangwrap.sh index 1d6dee28a8..dca3fcc904 100755 --- a/misc/ios/clangwrap.sh +++ b/misc/ios/clangwrap.sh @@ -2,17 +2,19 @@ # This uses the latest available iOS SDK, which is recommended. # To select a specific SDK, run 'xcodebuild -showsdks' # to see the available SDKs and replace iphoneos with one of them. -SDK=iphoneos -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` - if [ "$GOARCH" == "arm64" ]; then + SDK=iphoneos + PLATFORM=ios CLANGARCH="arm64" else - echo "unknown GOARCH=$GOARCH" >&2 - exit 1 + SDK=iphonesimulator + PLATFORM=ios-simulator + CLANGARCH="x86_64" fi -exec "$CLANG" -arch $CLANGARCH -isysroot "$SDK_PATH" -mios-version-min=10.0 "$@" +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 $CLANGARCH -isysroot "$SDK_PATH" -m${PLATFORM}-version-min=10.0 "$@" |