Skip to content

Commit 25e5bc2

Browse files
committed
[cxx-interop][libswift][build] Enable C++ interop when building libSwift
1 parent 5d2dd07 commit 25e5bc2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,10 +722,15 @@ endfunction()
722722
# This is a temporary workaround until it's possible to compile libswift with
723723
# cmake's builtin swift support.
724724
function(add_libswift name)
725+
set(libswift_compile_options
726+
"-target" "x86_64-apple-macosx10.15" # TODO: this is a hack until I figure out where the target is being set.
727+
"-Xfrontend" "-validate-tbd-against-ir=none"
728+
"-Xfrontend" "-enable-cxx-interop")
729+
725730
if(CMAKE_BUILD_TYPE STREQUAL Debug)
726-
set(libswift_compile_options "-g")
731+
list(APPEND libswift_compile_options "-g")
727732
else()
728-
set(libswift_compile_options "-O" "-cross-module-optimization")
733+
list(APPEND libswift_compile_options "-O" "-cross-module-optimization")
729734
endif()
730735
731736
set(build_dir ${CMAKE_CURRENT_BINARY_DIR})

0 commit comments

Comments
 (0)