I have been using the Cpp-Swift Interoperability in Xcode15 for direct communication between Cpp and Swift5.9. It required a few Build settings changes for the Swift Compiler, creating clang modules(module map file) to access cpp code in swift, specifying module map path to the swift compiler etc.
I wanted to use this interoperability feature in my visual studio project which is using Cmake. I want to build via cmake, using Xcode generator.
Prior to Swift5.9, we were using a ObjC bridging header whose support was provided in the Cmake using the Xcode attribute flag ‘XCODE_ATTRIBUTE_SWIFT_OBJC_BRIDGING_HEADER’. Similarly we were specifying the generated header using the attribute ‘XCODE_ATTRIBUTE_SWIFT_OBJC_INTERFACE_HEADER_NAME’
I m not able to find similar Xcode attribute property flags for my Cmake to enable this interoperability. Some attributes that are requires for this new interoperability are:
- to set the C++ and Objective-C Interoperability in the Swift Compiler - Language setting in Xcode.
- to set the import paths in the Swift Compiler - Search Paths : to have access to the module map file
- to set the Generated Header Name in the Swift Compiler - General settings in Xcode.
What are the changes that we need to make in the Cmake(using Xcode generator) for this new interoperability to work. Can someone help with this?