Text file
misc/ios/clangwrap.sh
1 #!/bin/sh
2 # This uses the latest available iOS SDK, which is recommended.
3 # To select a specific SDK, run 'xcodebuild -showsdks'
4 # to see the available SDKs and replace iphoneos with one of them.
5 if [ "$GOARCH" == "arm64" ]; then
6 SDK=iphoneos
7 PLATFORM=ios
8 CLANGARCH="arm64"
9 else
10 SDK=iphonesimulator
11 PLATFORM=ios-simulator
12 CLANGARCH="x86_64"
13 fi
14
15 SDK_PATH=`xcrun --sdk $SDK --show-sdk-path`
16 export IPHONEOS_DEPLOYMENT_TARGET=5.1
17 # cmd/cgo doesn't support llvm-gcc-4.2, so we have to use clang.
18 CLANG=`xcrun --sdk $SDK --find clang`
19
20 exec "$CLANG" -arch $CLANGARCH -isysroot "$SDK_PATH" -m${PLATFORM}-version-min=12.0 "$@"
21
View as plain text