I am creating an Xcode project using xcode generator in Cmake. The project has a library which contains cpp files and swift files. I m trying to test swift-cpp interoperability that is introduced in xcode15 to perform direct cpp calls from swift and vice-versa. For this to work, we need to set a xcode build setting 'C++ and Objective-C Interoperability' which I m doing via cmake, Below is my cmake file:
project(CxxInterop LANGUAGES CXX Swift)
#include the directory with modulemap file and Student.hpp
#setting the xcode C++ and Objective-C Interoperability setting
when building the generated xcode project I get the error
unknown argument: '-cxx-interoperability-mode=default'.
However the weird thing is when I separate out the cpp code in a different library and swift files in a different one, then this works and I m able to invoke the cpp methods in my swift file after importing the clang module from the module map file.
Is there any reason to why having cpp and swift files in same library producing this error? I m following this link to setup the project via cmake.