Use a C lib in Swift Package Manager

Hello,

I'm trying create a Package that uses a library called tidy-html5.

I've successfully created the package, however since I'm using homebrew as a provider, the dylib that gets created is only for x86 architecture. And ideally I would like to have it universal (ie also for iOS).

Is there a way to do this?

I manually created a universal dylib, but I'm not sure if I can add that as a dependency for SPM?

Thanks in advance.

Hey, I'm one of the maintainers of tidy-html5, and I'm trying to do the same thing. Did you make any progress?

In my case, I'm trying to have the package reference the source, so that it will build on any platform. I'm struggling to have all of the symbols from enum.h be recognized.

It looks like you're trying to build a [system] package, meaning that users will have to install the library themselves via brew or apt-get. That's common for Unix libraries, but I prefer static linking, and am struggling with Swift Package Manager. Without SPM, it's trivial to get them to build and work together in Xcode, but then that's an Xcode project and not a Swift Package.

Use a C lib in Swift Package Manager
 
 
Q