I am unable to find any recent information regarding whether it is possible to easily integrate a swiftpm project with a c++ library that cannot be built by swiftpm.
I have a c++ library which I can build with cmake, and I would like for my swiftpm project to depend on and use it. I have tried unsuccessfully to build the c++ library with cmake first, and then copy the headers into a swiftpm target, and link to the built .a file with cxxSettings, but this did not work ("could not build Objective-C module ...").
Is what I am trying to do even possible, and if so how would I accomplish it?
Starting with Swift 6.2 you can use static library dependencies. You can check my project on how to setup everything. If you follow the binaryTarget link inside my Package.swift you can checkout on how to setup the artifactbundle.
Just that short term. But I am looking into ways we can make it easier to integrate with CMake to build such libraries. This is a good use case. Thanks!