clangwrap.sh 626 B

1234567891011121314151617181920
  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. SDK_PATH=`xcrun --sdk $SDK --show-sdk-path`
  15. export IPHONEOS_DEPLOYMENT_TARGET=5.1
  16. # cmd/cgo doesn't support llvm-gcc-4.2, so we have to use clang.
  17. CLANG=`xcrun --sdk $SDK --find clang`
  18. exec "$CLANG" -arch $CLANGARCH -isysroot "$SDK_PATH" -m${PLATFORM}-version-min=12.0 "$@"