Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

941 B
Raw Blame
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/../.."
SDK=${SDK:-iphonesimulator}
if [[ $SDK == iphonesimulator ]]; then TARGET=(-target arm64-apple-ios26.0-simulator); else TARGET=(-target arm64-apple-macos26.0); fi
files=()
while IFS= read -r line; do [[ -z $line || $line == \#* ]] || files+=("$line"); done < ios/shared-sources.txt
shared=("${files[@]}")
while IFS= read -r f; do files+=("$f"); done < <(find ios/Sources -name '*.swift' | sort)
bad=$(awk '/^#if (os\(macOS\)|canImport\(AppKit\)|!CICADA_IOS)/{g=1} /^#endif/{g=0} !g && /^import (AppKit|CoreAudio|Carbon|ServiceManagement|IOKit)$/{print FILENAME": "$0}' "${shared[@]}")
if [[ -n $bad ]]; then echo "Mac-only imports in shared sources:"; echo "$bad"; exit 1; fi
xcrun swiftc -typecheck -swift-version 5 -module-name Cicada -sdk "$(xcrun --show-sdk-path --sdk "$SDK")" "${TARGET[@]}" \
  -D CICADA_IOS "${files[@]}"
echo "typecheck ok ($SDK, ${#files[@]} files)"