| 1 | #!/bin/sh |
| 2 | # Builds crates/mobile for the platform Xcode is building; Xcode links the static library. |
| 3 | set -eu |
| 4 | case "$PLATFORM_NAME" in |
| 5 | iphonesimulator) target=aarch64-apple-ios-sim ;; |
| 6 | *) target=aarch64-apple-ios ;; |
| 7 | esac |
| 8 | release= |
| 9 | [ "$CONFIGURATION" = Release ] && release=--release |
| 10 | root="$SRCROOT/../.." |
| 11 | # Xcode's SDK variables would point host build scripts at the iOS SDK. |
| 12 | exec env -i HOME="$HOME" PATH="$HOME/.cargo/bin:/etc/profiles/per-user/$USER/bin:/run/current-system/sw/bin:/usr/bin:/bin:/usr/sbin:/sbin" USER="$USER" \ |
| 13 | 	CARGO_TARGET_DIR="$root/target/ios" IPHONEOS_DEPLOYMENT_TARGET="$IPHONEOS_DEPLOYMENT_TARGET" \ |
| 14 | 	cargo build --manifest-path "$root/Cargo.toml" -p mobile --target "$target" $release |