I have a package with two dynamic library products, where product B depends on the targets of product A. When SwiftPM builds this package, it includes the symbols of all targets in product A in both products, meaning if an application links against both libraries it will have duplicate symbols.
The situation I want is that product B includes only its own targets and dynamically links against product A. I can hackily achieve this by not declaring the dependency in SwiftPM and manually building product B after product A, but this seems far from an ideal solution. Is there any better way to achieve this? Separating product B into its own package and using a
.product dependency doesn't quite work either; it correctly links against product A but also links in some upstream dependencies of product A, so there are still duplicate symbols.
To provide some context: product B is being
dlopened at runtime and
@_dynamicReplaces some stubbed out functions in product A. The configuration I want enables hot-reloading of module B.