Skip to content

Commit 05a60ba

Browse files
committed
build: spell the linker suffix properly on Windows
Windows requires that the .exe suffix be present to use the tools from the Android NDK.
1 parent 7e67bd4 commit 05a60ba

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,17 @@ if(ENABLE_SWIFT)
116116
POSITION_INDEPENDENT_CODE YES)
117117

118118
if(USE_LLD_LINKER)
119-
set(use_ld_flag -use-ld=lld)
119+
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
120+
set(use_ld_flag -use-ld=lld.exe)
121+
else()
122+
set(use_ld_flag -use-ld=lld)
123+
endif()
120124
elseif(USE_GOLD_LINKER)
121-
set(use_ld_flag -use-ld=gold)
125+
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
126+
set(use_ld_flag -use-ld=gold.exe)
127+
else()
128+
set(use_ld_flag -use-ld=gold)
129+
endif()
122130
endif()
123131

124132
add_swift_library(swiftDispatch

0 commit comments

Comments
 (0)