I would like to see examples of how to do this. Apple states that explicit clang modules don't work with C++ interop. ObjC++ has simple interop with C++. Swift does not. And so I'd like to know how to setup my C++ projects to build them as clang modules.
How to build clang modules to work with Swift/C++ interop
You can begin here: https://www.swift.org/documentation/cxx-interop/
Already followed all that and it doesn’t work.
Are you targeting Swift package manager? Or Xcode?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
I have C++ Xcode projects and Swift projects. These only work right now with a c-style bridging header. Apple doesn’t have any sample apps that build clang modules sinice they were released many years ago. Watched the WWDC on explicit modules, but then read these don’t work with Swift interop.
Have a modulemap file, -fmodules defined, but Swift still can’t see the C++ sources. one of the strengths of Apple development was ease of interop between ObjC++ and C++. Have had to wait until Swift 5/6 for something not under a C-wrapper. My code is on Swift 5 if that matters. But switching to Swift 6 is a concurrency warning flood.
Also when I have Swift 5 set in Xcode 16, is that 5.xx (f.e. 5.9 has interop) or 5.0?