xref: /aosp_15_r20/external/bazelbuild-rules_rust/examples/ios_build/check_arch.sh (revision d4726bddaa87cc4778e7472feed243fa4b6c267f)
1#!/bin/bash
2#
3# When compiling with --platforms=//:ios_sim_arm64 or --platforms=//:ios_x86_64,
4# the library should not contain any references to macOS (platform 1)
5
6set -e
7
8if [[ "$OSTYPE" != "darwin"* ]]; then
9    echo "This test only makes sense on macOS."
10    exit 0
11fi
12
13if otool -l $1 | grep 'platform 1'; then
14    echo "macOS detected."
15    exit 1
16fi