Skip to content

Commit b9476ce

Browse files
committed
build: correct handling of argument generation
This adjusts the target specific argument handling to use the same logic as the toolchain, and in doing so, silences the spurious warnings when building with a MSVC toolchain.
1 parent 09141ce commit b9476ce

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmake/modules/AddSwiftUnittests.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ function(add_swift_unittest test_dirname)
5757
_ENABLE_EXTENDED_ALIGNED_STORAGE)
5858
endif()
5959

60-
if(SWIFT_USE_LINKER)
61-
set_property(TARGET "${test_dirname}" APPEND_STRING PROPERTY
62-
LINK_FLAGS " -fuse-ld=${SWIFT_USE_LINKER}")
60+
if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
61+
if(SWIFT_USE_LINKER)
62+
target_link_options(${test_dirname} PRIVATE
63+
-fuse-ld=${SWIFT_USE_LINKER}$<$<STREQUAL:${CMAKE_HOST_SYSTEM_NAME},Windows>:.exe>)
64+
endif()
6365
endif()
6466

6567
if(SWIFT_ANALYZE_CODE_COVERAGE)

0 commit comments

Comments
 (0)