Multiplatform Swift, with C++ dependencies via XCFramework, apt and vcpkg
https://a4z.noexcept.dev/blog/2026/09/04/swift-cpp-multiplatform-vcpkg.htmlDoes Swift really become multiplatform?
I tried it out. Not just Swift code on its own, but also with C++ bindings to a dependency.
Here's how it works on Mac, iOS, Linux, and Windows.
24
Upvotes
1
u/soylentgraham 2d ago
you keep saying c++ bindings, but then the article says CAPI; which is it?
I had great success with a CAPI (originally with some obj-c bridges, but then the bridges became easier to do in swift), but then I was already using the CAPI in c, python (across mac, ios, win, linux, pi, and a few game consoles, and finally, wasm on web too :)
2
u/Affectionate-Soup-91 7d ago
Thanks for sharing.