Skip to content

Commit 618b070

Browse files
Merge pull request #439 from compnerd/android-wins
build: add executable suffix for `-fuse-ld=`
2 parents 60ffcc2 + a04e1f5 commit 618b070

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmake/modules/DispatchUtilities.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11

22
function(dispatch_set_linker target)
3+
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
4+
set(CMAKE_HOST_EXECUTABLE_SUFFIX .exe)
5+
endif()
6+
37
if(USE_GOLD_LINKER)
48
set_property(TARGET ${target}
59
APPEND_STRING
610
PROPERTY LINK_FLAGS
7-
-fuse-ld=gold)
11+
-fuse-ld=gold${CMAKE_HOST_EXECUTABLE_SUFFIX})
812
endif()
913
if(USE_LLD_LINKER)
1014
set_property(TARGET ${target}
1115
APPEND_STRING
1216
PROPERTY LINK_FLAGS
13-
-fuse-ld=lld)
17+
-fuse-ld=lld${CMAKE_HOST_EXECUTABLE_SUFFIX})
1418
endif()
1519
endfunction()

0 commit comments

Comments
 (0)