Skip to content

Commit d2e85fa

Browse files
authored
Merge pull request #25459 from compnerd/what-is-an-executable
build: spell parameter `-fuse-ld=` properly for Windows
2 parents 06527db + bee99a3 commit d2e85fa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,12 @@ function(_add_variant_link_flags)
517517
NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WINDOWS"))
518518
list(APPEND result "-fuse-ld=lld")
519519
elseif(SWIFT_ENABLE_GOLD_LINKER AND
520-
"${SWIFT_SDK_${LFLAGS_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
521-
list(APPEND result "-fuse-ld=gold")
520+
"${SWIFT_SDK_${LFLAGS_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
521+
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
522+
list(APPEND result "-fuse-ld=gold.exe")
523+
else()
524+
list(APPEND result "-fuse-ld=gold")
525+
endif()
522526
endif()
523527
endif()
524528

0 commit comments

Comments
 (0)