SPM: Custom Framework with multiple targets

There isn’t much to say beyond what is already in the other thread you linked from Stack Overflow:

If it were me, I would simply factor the shared files out into a module C that both A and B can depend on.

Sharing files between targets isn’t something SwiftPM intentionally supports at the moment, but if none of the workarounds from the other thread work for you, you might be able to use symlinks to trick SwiftPM into thinking there are two separate files.

2 Likes