2014-12-25 23:24:42 -07:00
|
|
|
#!/bin/sh
|
2024-03-20 17:09:10 -06:00
|
|
|
|
|
|
|
# This script configures clang to target the iOS simulator. If you'd like to
|
|
|
|
# build for real iOS devices, change SDK to "iphoneos" and PLATFORM to "ios".
|
|
|
|
# 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
|
|
|
|
# iphonesimulator with one of them.
|
|
|
|
|
|
|
|
SDK=iphonesimulator
|
|
|
|
PLATFORM=ios-simulator
|
|
|
|
|
2020-04-03 10:22:27 -06:00
|
|
|
if [ "$GOARCH" == "arm64" ]; then
|
2015-04-11 17:44:18 -06:00
|
|
|
CLANGARCH="arm64"
|
|
|
|
else
|
2020-09-16 07:23:58 -06:00
|
|
|
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`
|
2024-03-20 17:09:10 -06:00
|
|
|
|
2020-09-16 07:23:58 -06:00
|
|
|
# cmd/cgo doesn't support llvm-gcc-4.2, so we have to use clang.
|
|
|
|
CLANG=`xcrun --sdk $SDK --find clang`
|
|
|
|
|
2021-12-02 08:01:09 -07:00
|
|
|
exec "$CLANG" -arch $CLANGARCH -isysroot "$SDK_PATH" -m${PLATFORM}-version-min=12.0 "$@"
|