diff options
author | Brad King <brad.king@kitware.com> | 2024-01-10 15:20:28 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-01-10 15:20:37 (GMT) |
commit | 1e8b283554bddc1461eb243ac0079b330d8f1105 (patch) | |
tree | ec10987e15152079149ec1189b16b7f307f5ba97 /Tests | |
parent | 4a9599927f750972f16f6e7615853a971f0913da (diff) | |
parent | 9e829779f249402071ee979705728db3066000fa (diff) | |
download | CMake-1e8b283554bddc1461eb243ac0079b330d8f1105.zip CMake-1e8b283554bddc1461eb243ac0079b330d8f1105.tar.gz CMake-1e8b283554bddc1461eb243ac0079b330d8f1105.tar.bz2 |
Merge topic 'static'
9e829779f2 Swift: preserve `-static` for static library swiftmodules
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9141
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/Swift/RunCMakeTest.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/Swift/SwiftLibraryModuleCommand-check-stdout.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/Swift/SwiftLibraryModuleCommand.cmake | 8 |
3 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/Swift/RunCMakeTest.cmake b/Tests/RunCMake/Swift/RunCMakeTest.cmake index 5de4346..b5210c9 100644 --- a/Tests/RunCMake/Swift/RunCMakeTest.cmake +++ b/Tests/RunCMake/Swift/RunCMakeTest.cmake @@ -76,6 +76,12 @@ elseif(RunCMake_GENERATOR STREQUAL Ninja) # -v: verbose to capture executed commands -n: dry-run to avoid actually compiling run_cmake_command(ForceResponseFile-check ${CMAKE_COMMAND} --build ${ForceResponseFile_TEST_BINARY_DIR} -- -vn) 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) + endblock() endif() elseif(RunCMake_GENERATOR STREQUAL "Ninja Multi-Config") if(CMake_TEST_Swift) diff --git a/Tests/RunCMake/Swift/SwiftLibraryModuleCommand-check-stdout.txt b/Tests/RunCMake/Swift/SwiftLibraryModuleCommand-check-stdout.txt new file mode 100644 index 0000000..85767eb --- /dev/null +++ b/Tests/RunCMake/Swift/SwiftLibraryModuleCommand-check-stdout.txt @@ -0,0 +1,3 @@ +.*swiftc(.exe)? .* -parse-as-library -static -emit-module .* -module-name StaticLibrary [^ +]* +.*swiftc(.exe)? .* -parse-as-library -emit-module .* -module-name DynamicLibrary diff --git a/Tests/RunCMake/Swift/SwiftLibraryModuleCommand.cmake b/Tests/RunCMake/Swift/SwiftLibraryModuleCommand.cmake new file mode 100644 index 0000000..7127751 --- /dev/null +++ b/Tests/RunCMake/Swift/SwiftLibraryModuleCommand.cmake @@ -0,0 +1,8 @@ +if(POLICY CMP0157) + cmake_policy(SET CMP0157 NEW) +endif() + +enable_language(Swift) + +add_library(StaticLibrary STATIC L.swift) +add_library(DynamicLibrary SHARED L.swift) |