2014-12-25 23:24:42 -07:00
|
|
|
#!/bin/sh
|
|
|
|
# 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.
|
2020-04-03 10:22:27 -06:00
|
|
|
if [ "$GOARCH" == "arm64" ]; then
|
2020-09-16 07:23:58 -06:00
|
|
|
SDK=iphoneos
|
|
|
|
PLATFORM=ios
|
2015-04-11 17:44:18 -06:00
|
|
|
CLANGARCH="arm64"
|
|
|
|
else
|
2020-09-16 07:23:58 -06:00
|
|
|
SDK=iphonesimulator
|
|
|
|
PLATFORM=ios-simulator
|
|
|
|
CLANGARCH="x86_64"
|
2015-04-11 17:44:18 -06:00
|
|
|
fi
|
|
|
|
|
2020-09-16 07:23:58 -06:00
|
|
|
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 "$@"
|