Hmm. Not sure this works for our use case.
I need to dynamically link an XCFramework, which is in RepoRoot/Carthage/Build/
directory, to a Swift Package that is in RepoRoot/MyLocalPackages/MyPackage/
.
How can I do this without resorting to "unsafe flags" that make the package unable to be used by anything else?
Our app has ~15 Carthage dependency XCFrameworks that are already being linked into, and embedded into, our app and its various frameworks, none of which are Swift Packages. (There are about 40.)
Now we want to add new, local Swift packages (not distributed), which need to depend on those same XCFrameworks from the Carthage folder. How can we do this?
It seems the only facilities for linking to a binary that exist in SPM are just for people who are distributing static binaries, like Google Firebase. You cannot wrap an XCFramework in a dynamic library target in SPM. And you cannot specify a binary target that is outside of the package's own directory structure, unless it's on a remote server (as if that limitation makes sense). (Even if you could, from what I can tell, it still wouldn't work, because xcodebuild doesn't make sure the linked frameworks get put into the build folder before it tries to compile package code that depends on them, resulting in build errors.)
I just want a way to use binary frameworks from the Carthage folder with my Swift packages. Surely, there's a way to do that?