From b9476ce72adf53d0b7bb69fe74704cee9a019719 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 19 Jun 2020 13:58:02 -0700 Subject: [PATCH] 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. --- cmake/modules/AddSwiftUnittests.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/modules/AddSwiftUnittests.cmake b/cmake/modules/AddSwiftUnittests.cmake index 811b455bd3ed2..531916e071b79 100644 --- a/cmake/modules/AddSwiftUnittests.cmake +++ b/cmake/modules/AddSwiftUnittests.cmake @@ -57,9 +57,11 @@ function(add_swift_unittest test_dirname) _ENABLE_EXTENDED_ALIGNED_STORAGE) endif() - if(SWIFT_USE_LINKER) - set_property(TARGET "${test_dirname}" APPEND_STRING PROPERTY - LINK_FLAGS " -fuse-ld=${SWIFT_USE_LINKER}") + if(NOT SWIFT_COMPILER_IS_MSVC_LIKE) + if(SWIFT_USE_LINKER) + target_link_options(${test_dirname} PRIVATE + -fuse-ld=${SWIFT_USE_LINKER}$<$:.exe>) + endif() endif() if(SWIFT_ANALYZE_CODE_COVERAGE)