From 5480f65ab1c7b7ffae624f9b7596b36370aa8c9b Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sun, 11 Aug 2019 22:27:46 -0700 Subject: Swift: honour `IMPLIB_LOCATION` property The rules did not account for the import library location (through ``) and instead would always write the import library to the default location (next to the shared library/executable). This prevented the use of `CMAKE_RUNTIME_OUTPUT_LOCATION` and `CMAKE_ARCHIVE_OUTPUT_LOCATION`. --- Modules/CMakeSwiftInformation.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 54e441c..bf3ca40 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -64,8 +64,12 @@ if(NOT CMAKE_Swift_NUM_THREADS MATCHES "^[0-9]+$") cmake_host_system_information(RESULT CMAKE_Swift_NUM_THREADS QUERY NUMBER_OF_LOGICAL_CORES) endif() +if(CMAKE_SYSTEM_NAME STREQUAL Windows) + set(CMAKE_Swift_IMPLIB_LINKER_FLAGS "-Xlinker -implib:") +endif() + if(NOT CMAKE_Swift_CREATE_SHARED_LIBRARY) - set(CMAKE_Swift_CREATE_SHARED_LIBRARY " -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_CREATE_SHARED_LIBRARY " -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ${CMAKE_Swift_IMPLIB_LINKER_FLAGS} ") endif() if(NOT CMAKE_Swift_CREATE_SHARED_MODULE) @@ -73,7 +77,7 @@ if(NOT CMAKE_Swift_CREATE_SHARED_MODULE) endif() if(NOT CMAKE_Swift_LINK_EXECUTABLE) - set(CMAKE_Swift_LINK_EXECUTABLE " -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_LINK_EXECUTABLE " -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o -emit-module -emit-module-path -emit-dependencies ${CMAKE_Swift_IMPLIB_LINKER_FLAGS} ") endif() if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY) -- cgit v0.12