Linking a Rust staticlib with C header in a Swift package

I have an Obj-C framework where Header Search Paths and Swift’s Import Paths are set to the include of a Rust-generated C header and Library Search Paths is set to the folders containing the Rust-built static libraries.

How would I do this with SPM? I didn’t manage to get it to link.

I had a Swift target which depended on a target where I attempted to use -Xlinker -L$LIB_PATH in unsafeFlags for linkerSettings but it didn’t work.

Thanks!

Here’s the solution.

Terms of Service

Privacy Policy

Cookie Policy