Using Swift Package with local binaryTarget

Can somebody confirm if my expectation is correct?

  • I have an internal c++ project
  • I create a .framework and .xcframework from the c++ project
  • the .xcframework can be used without embedding in macOS (but is also intended for iOS at some point)
  • embed & sign the framework gives a code signing error (tips on resolving this are welcome because I tried signing the .framework using codesign)
  • I create a swift package with a local .binaryTarget that references the .xcframework. Its inside a folder Frameworks/
  • the package compiles using xcodebuild
  • when I add the package to a macOS project, the frameworks are visible
  • when I add these frameworks manually (again as Do Not Embed) it works
  • but adding only the package doesn't work

My expectation is that I would only need to add the swift package and that the Xcode or the compiler would figure out that it contains the required frameworks. Or is that wrong and do I always need to add them manually?

The package contains no other code. It's just a front for a collection of frameworks that (will eventually) requires distribution.