Skip to content

Commit 987faae

Browse files
committed
[cmake] Fix fallout from pull request #37741
1 parent bfef818 commit 987faae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,11 @@ function(_add_host_variant_link_flags target)
371371
if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
372372
if(SWIFT_USE_LINKER)
373373
target_link_options(${target} PRIVATE
374-
-fuse-ld=${SWIFT_USE_LINKER}$<$<STREQUAL:${CMAKE_HOST_SYSTEM_NAME},Windows>:.exe>)
374+
$<$<LINK_LANGUAGE:CXX>:-fuse-ld=${SWIFT_USE_LINKER}$<$<STREQUAL:${CMAKE_HOST_SYSTEM_NAME},Windows>:.exe>>)
375+
if (CMAKE_Swift_COMPILER)
376+
target_link_options(${target} PRIVATE
377+
$<$<LINK_LANGUAGE:Swift>:-use-ld=${SWIFT_USE_LINKER}$<$<STREQUAL:${CMAKE_HOST_SYSTEM_NAME},Windows>:.exe>>)
378+
endif()
375379
endif()
376380
endif()
377381

0 commit comments

Comments
 (0)