How to import bridge header file to swift project through CMake for Ninja?

HI, I have a swift project and I am calling few objective C APIs as part of my swift project. I am using bridge header for this.

I am creating swift project using CMake files. I able to create the swift project and compiling successfully for Xcode But I unable to compile successfully for Ninja.

I am using XCODE_ATTRIBUTE_SWIFT_OBJC_BRIDGING_HEADER to import bridge header file to the swift project in my CMake file like set_target_properties(ADE PROPERTIES  FRAMEWORK TRUE  XCODE_ATTRIBUTE_SWIFT_OBJC_BRIDGING_HEADER ADE-Bridging-Header.h). But I failed to import successfully for Ninja. Is there any way to import Bridge header file through CMake for both Xcode and Ninja?

Accepted Reply

set(CMAKE_Swift_FLAGS "${CMAKE_Swift_FLAGS} -import-objc-header ADE-Bridging-Header.h" ) in CMake solves the my problem in both Ninja and Xcode.

Replies

set(CMAKE_Swift_FLAGS "${CMAKE_Swift_FLAGS} -import-objc-header ADE-Bridging-Header.h" ) in CMake solves the my problem in both Ninja and Xcode.