summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-01-11 15:06:04 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-01-11 15:06:39 (GMT)
commit97713da65024c784cc759278e5a4ebc79a74f111 (patch)
tree01acc210e1ebc151aae44c99ef0e70fc1beb9189 /Tests
parent1c02642ee6d20a74533c12092c29c57f760809d8 (diff)
parenta2aad7eb8d84d40c13122c6d0a297ff3061baa6c (diff)
downloadCMake-97713da65024c784cc759278e5a4ebc79a74f111.zip
CMake-97713da65024c784cc759278e5a4ebc79a74f111.tar.gz
CMake-97713da65024c784cc759278e5a4ebc79a74f111.tar.bz2
Merge topic 'swift-implib'
a2aad7eb8d Swift: fix Windows DLL import library support for CMP0157 NEW Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Acked-by: Jeremy Day <jadaytime@gmail.com> Merge-request: !9140
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/Swift/ImportLibraryFlags-check-stdout.txt1
-rw-r--r--Tests/RunCMake/Swift/ImportLibraryFlags.cmake6
-rw-r--r--Tests/RunCMake/Swift/RunCMakeTest.cmake8
3 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/Swift/ImportLibraryFlags-check-stdout.txt b/Tests/RunCMake/Swift/ImportLibraryFlags-check-stdout.txt
new file mode 100644
index 0000000..9b53820
--- /dev/null
+++ b/Tests/RunCMake/Swift/ImportLibraryFlags-check-stdout.txt
@@ -0,0 +1 @@
+.*-implib:lib\\L.lib
diff --git a/Tests/RunCMake/Swift/ImportLibraryFlags.cmake b/Tests/RunCMake/Swift/ImportLibraryFlags.cmake
new file mode 100644
index 0000000..4c76b40
--- /dev/null
+++ b/Tests/RunCMake/Swift/ImportLibraryFlags.cmake
@@ -0,0 +1,6 @@
+cmake_policy(SET CMP0157 NEW)
+enable_language(Swift)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+add_library(L SHARED L.swift)
diff --git a/Tests/RunCMake/Swift/RunCMakeTest.cmake b/Tests/RunCMake/Swift/RunCMakeTest.cmake
index b5210c9..56158e3 100644
--- a/Tests/RunCMake/Swift/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Swift/RunCMakeTest.cmake
@@ -78,6 +78,14 @@ elseif(RunCMake_GENERATOR STREQUAL Ninja)
endblock()
block()
+ if(CMAKE_SYSTEM_NAME MATCHES Windows)
+ set(ImportLibraryFlags_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SwiftLibraryModuleCommand-build)
+ run_cmake(ImportLibraryFlags)
+ run_cmake_command(ImportLibraryFlags-check ${CMAKE_COMMAND} --build ${SwiftLibraryModuleCommand_TEST_BINARY_DIR} -- -n -v)
+ endif()
+ endblock()
+
+ block()
set(SwiftLibraryModuleCommand_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SwiftLibraryModuleCommand-build)
run_cmake(SwiftLibraryModuleCommand)
run_cmake_command(SwiftLibraryModuleCommand-check ${CMAKE_COMMAND} --build ${SwiftLibraryModuleCommand_TEST_BINARY_DIR} -- -n -v)