According to the SwiftPM documentation, when defining the type of a package:
Leave this parameter unspecified to let to let the Swift Package Manager choose between static or dynamic linking (recommended).
However, when using such libraries from Xcode in a fairly simple setup and running unit tests, Xcode complains about duplicated symbols:
objc: Class _TtC8Deferred18POSIXReadWriteLock is implemented in both /Users/pcifani/Library/Developer/CoreSimulator/Devices/835DF32C-44B3-4841-B6CB-A7B2D12744D7/data/Containers/Bundle/Application/C5053FF1-BF0D-434A-94C6-BAAE5FF414F0/VideoAsk.app/Frameworks/BSWFoundation.framework/BSWFoundation (0x10825ec48) and /Users/pcifani/Library/Developer/CoreSimulator/Devices/835DF32C-44B3-4841-B6CB-A7B2D12744D7/data/Containers/Bundle/Application/C5053FF1-BF0D-434A-94C6-BAAE5FF414F0/VideoAsk.app/VideoAsk (0x106c31310). One of the two will be used. Which one is undefined.
The app's dependency tree looks like this: libFoo depends on libBar and App depends on both libFoo and libBar, and the Tests bundle for the App depends on both the app and the library.
I can't find any option in Xcode's UI to "force" the libraries to be dynamic, and SwiftPM seems to not see this issue when linking the packages and choosing a dynamic configuration for me.
Any workaround except forking the library and setting all the types to .dynamic?