Swift Package dynamic linking with static xcframework

Bonjour everyone,

I would love some help, or just your insight...
  • I was given a version of CouchbaseLite as a fat framework and I don't want to use any other version

  • I extracted architectures arm64 & x86_64 with "lipo -thin"

  • then I created CouchbaseLite.xcframework with xcodebuild -create-xcframework

So far this is a success.
Note that the fat framework is a static framework, therefore CouchbaseLite.xcframework packages a static framework.
  • I am trying to convert a dynamic framework, lets name it MyFramework that links with CouchbaseLite into a swift package. Since CouchbaseLite is static, no need to carry CouchbaseLite to parent projects, MyFramework should be enough.

  • I have the choice to expose the binary target either directly in MyFramework/Package.swift or in a dedicated Package.swift for CouchbaseLite.

  • I mark "CouchbaseLite" as a dependency

.. compiling works fine, but whenever I bring MyFramework as a swift package in a project, import <CouchbaseLite/CouchbaseLite.h> fails to be found.

Please, some help.


  • I have tried another approach which is to have CouchbaseLite.xcframework as a resource of package MyFramework, and .process("CouchbaseLite.xcframework") but no luck...


Swift Package dynamic linking with static xcframework
 
 
Q