even less bad

This commit is contained in:
Alex Zenla 2024-08-03 22:20:21 -07:00
parent 34bf06ab87
commit 163acbf1b0
Signed by: alex
GPG Key ID: C0780728420EBFE5
2 changed files with 3 additions and 2 deletions

View File

@ -1,3 +1,3 @@
# C++ to Swift interop
# Swift into C++ interop
This is a C++ backend which is callable from Swift code. It is also possible to do bidirectional C++ to Swift, see https://github.com/apple/swift-cmake-examples/tree/main/3_bidirectional_cxx_interop

View File

@ -1,5 +1,6 @@
add_library(CppBackend STATIC backend.h backend.cpp)
set_property(TARGET CppBackend PROPERTY Swift_MODULE_NAME "CppBackend")
set_property(TARGET CppBackend PROPERTY CXX_STANDARD 20)
set_target_properties(CppBackend PROPERTIES Swift_MODULE_NAME "CppBackend")
target_compile_options(CppBackend PUBLIC "$<$<COMPILE_LANGUAGE:Swift>:-cxx-interoperability-mode=default>")
target_include_directories(CppBackend PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")