Hey.
I have been wondering if it is possible to distribute a swift package in a compiled form? The way you can distribute c source code using .h
and .o
files.
In this way, the developer can distribute the package without revealing the underlying source code, and removes the need to compile the module again and again. The latter is extremely important since the compile time for swift syntax
, which is required for building macros, is extremely long when -WMO
.
1 Like
After some digging in the forums, it seems I can use XCFrameworks.
Also found this, the compiled version of swift package.
XCFrameworks will work on macOS, but i am not aware of any way to distribute precompiled dependencies on linux (or Windows, for that matter.)
1 Like
Only Darwin platforms support ABI and module stability for Swift. On those platforms you can use binary target artifact format since Swift 5.3.
3 Likes