Before jumping in, we dont have a fully fleshed out design for how Embedded Swift will interact with SwiftPM.
To make use of Embedded Swift easier with SwiftPM @kubamracek @Max_Desiatov @bnbarham and I discussed the following short term changes:
-
Let's keep the per-target opt-in in Package.swift with experimental features.
-
Let's add a
swift build
flag to turn on Embedded for the whole build filterable with--target
and--product
Add flag for building target module graph with experimental feature Embedded · Issue #7611 · apple/swift-package-manager · GitHub -
Let's pass down
-Xfrontend -emit-empty-object-file
from swiftpm to the compiler for every non-leaf module building with Embedded.
Add `-Xfrontend -emit-empty-object-file` when Embedded is enabled for leaf modules · Issue #7612 · apple/swift-package-manager · GitHub -
Let's pass down
-wmo
from swiftpm to the compiler for every module building with Embedded.
Enable -wmo when Embedded is enabled · Issue #7613 · apple/swift-package-manager · GitHub
Nope, maybe an interesting direction.
One option is passing them as -Xswiftc
and -Xcc
flags to swift build
manually
Edit: I've updated the above list with links to SwiftPM issues.