1#!/bin/sh
2# Builds crates/mobile for the platform Xcode is building; Xcode links the static library.
3set -eu
4case "$PLATFORM_NAME" in
5iphonesimulator) target=aarch64-apple-ios-sim ;;
6*) target=aarch64-apple-ios ;;
7esac
8release=
9[ "$CONFIGURATION" = Release ] && release=--release
10root="$SRCROOT/../.."
11# Xcode's SDK variables would point host build scripts at the iOS SDK.
12exec 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