Для этого надо скачать и установить дополнительный пакет.
Пересобираем тот же пример в статике:wget https://download.swift.org/swift-6.0-release/static-sdk/swift-6.0-RELEASE/swift-6.0-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
swift sdk install swift-6.0-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
Размер бинарника 5 мегабайт. Немало, но и не ужас-ужас.$ cd ~/hello-swift
$ swift build --swift-sdk aarch64-swift-linux-musl -c release
Building for production...
[5/5] Linking hello-swift
Build complete! (0.59s)
$ .build/release/hello-swift
Hello, world!
$ ldd .build/release/hello-swift
not a dynamic executable
$ size .build/release/hello-swift
text data bss dec hex filename
5092581 1125304 180652 6398537 61a249 .build/release/hello-swift

no subject
Date: 2024-09-20 05:13 (UTC)no subject
Date: 2024-09-20 05:57 (UTC)https://github.com/swiftlang/swift/blob/main/docs/WindowsCrossCompile.md
https://www.swift.org/blog/swift-everywhere-windows-interop/