SPM: Merge multiple targets into a single module

Hello Swift Forum,

In my Xcode project I have a big framework with mixed Objective-C and Swift sources and I'm experimenting migrating it to Swift Package Manager. I had to break it up in several targets because of the mixed codebase. It works great, however now the clients of this framework have to import each individual target separately, when before they would just import the whole framework once.

Is there a way to merge all the targets into a single module? Thanks in advance.

It is not possible with the officially supported stable features, but the experimental @_exported import can be used in the top module so that clients get the others with it automatically.

1 Like

Yeah, currently doing that, but apparently this doesn't work when importing from Objective-C.

Terms of Service

Privacy Policy

Cookie Policy