#!/bin/bash set -euo pipefail cd "$(dirname "$0")" SRC="Sources/AppleSpeechCLI/main.swift" OUT=".build/release/apple-speech-transcribe" mkdir -p .build/release # Use swiftc directly with macOS 26.5 SDK # Swift 6.3.3 supports typed throws, Speech new API compiles fine with swiftc echo "Compiling apple-speech-transcribe with swiftc..." swiftc -O -parse-as-library \ -target arm64-apple-macosx26.0 \ -sdk /Library/Developer/CommandLineTools/SDKs/MacOSX26.5.sdk \ "$SRC" -o "$OUT" \ -framework Speech -framework AVFoundation -framework Foundation echo "Built: $OUT" ls -lh "$OUT" "$OUT" --check 2>&1 || true # Also copy to project root for python use cp "$OUT" ../apple-speech-transcribe 2>/dev/null || cp "$OUT" ./apple-speech-transcribe echo "Copied to ../apple-speech-transcribe and ./apple-speech-transcribe"