Skip to content

Commit bc6dbd4

Browse files
committed
[cmake] Force the linker_language of host executables to be CXX.
In certain cases our executables are going to have a mix of cxx,swift. There are current issues when linking cxx,swift code with swiftc itself, so this lets us avoid that problem.
1 parent 7e439ee commit bc6dbd4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,9 @@ function(add_swift_host_tool executable)
572572
_add_host_variant_c_compile_link_flags(${executable})
573573
target_link_directories(${executable} PRIVATE
574574
${SWIFTLIB_DIR}/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR})
575+
# Force executables linker language to be CXX so that we do not link using the
576+
# host toolchain swiftc.
577+
set_target_properties(${executable} PROPERTIES LINKER_LANGUAGE CXX)
575578
add_dependencies(${executable} ${LLVM_COMMON_DEPENDS})
576579
577580
set_target_properties(${executable} PROPERTIES

0 commit comments

Comments
 (0)