#!/bin/bash set -euo pipefail cd "$(dirname "$0")/.." out="${1:-.check-build}" mkdir -p "$out/tmp" "$out/modules" out="$(cd "$out" && pwd)" export TMPDIR="$out/tmp" CLANG_MODULE_CACHE_PATH="$out/modules" swift=(xcrun swiftc -parse-as-library -module-cache-path "$out/modules") "${swift[@]}" -D GROUNDROOM_SELF_TEST Sources/Groundroom.swift -o "$out/GroundroomChecks" "$out/GroundroomChecks" "${swift[@]}" Sources/RoomLayout.swift Checks/LayoutChecks.swift -o "$out/LayoutChecks" "$out/LayoutChecks" for entry in 'macosx arm64-apple-macosx14.0 Mac' 'iphoneos arm64-apple-ios17.0 iPhone-iPad' 'xros arm64-apple-xros2.0 VisionPro' 'xrsimulator arm64-apple-xros2.0-simulator VisionSimulator'; do set -- $entry sdk=$1 target=$2 name=$3 "${swift[@]}" -target "$target" -sdk "$(xcrun --sdk "$sdk" --show-sdk-path)" Sources/*.swift -o "$out/$name" xcrun vtool -show-build "$out/$name" | grep -E 'platform|minos' | tr -s ' ' done