Using Binary frameworks dependencies in a Swift package

Hi there! I'm currently working on a project where I'm writing a swift package. This package requires a vendor binary frameworks as a dependency. Unfortunately, I have been unable to find a way to link it or to find any relevant documentation to that matter.

I found a reference to linkerSettings -> linkedFramework that let me think this is possible. I also saw information saying that autolinked frameworks should be the default behaviour. however, all my attempts failed dramatically.

So here are my questions :
Are binary frameworks dependencies possible within swiftPM? And if yes how does that work? (if you have any link to some documentation that will be a cherry on top)
Thank you in advance.

Binary frameworks are supported only in limited fashion by SwiftPM.

You cannot vend a package that has a dependency on a binary framework, and SwiftPM itself has no prescribed pattern for linking and depending on binaries in your packages.

See Binary Frameworks with SwiftPM, Distributing Binary (closed source) Libraries, and SPM Support for Binaries Distribution

Thanks a lot for your answer, I have read those links already, but I found myself unable to make things works.

I understand that binary embedded inside a package is not possible and goes against the philosophy of SwiftPM . Also I thought it was possible to link the binary in the main project and when the project is compiled (and the package with it) the package finally find the needed binary. But once again I failed totally to do so... Am I understanding it wrong or am I doing it wrong?

We just posted a potential approach for integrating binary dependencies in SwiftPM. You can see the discussion here

Terms of Service

Privacy Policy

Cookie Policy