summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorEvan Wilde <etceterawilde@gmail.com>2024-02-23 00:53:50 (GMT)
committerBrad King <brad.king@kitware.com>2024-02-23 16:12:05 (GMT)
commitf292e28b84a8df50a8c4523c04f5e9eacc2ee772 (patch)
tree6206f711656676e39e2d154d54a2ed56471d5e8d /Tests/RunCMake
parent9cd34156f41f428df2febd2f5782c6080e8a6fa0 (diff)
downloadCMake-f292e28b84a8df50a8c4523c04f5e9eacc2ee772.zip
CMake-f292e28b84a8df50a8c4523c04f5e9eacc2ee772.tar.gz
CMake-f292e28b84a8df50a8c4523c04f5e9eacc2ee772.tar.bz2
Swift: Ninja: Pass module name to all swift builds
Executables that don't export a public API should not emit a swiftmodule, but the swift modulename is observable from within the program, so we should still set the module name on executable builds. Fixes: #25710
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/Swift/SwiftLibraryModuleCommand-check-stdout.txt4
-rw-r--r--Tests/RunCMake/Swift/SwiftLibraryModuleCommand.cmake4
2 files changed, 7 insertions, 1 deletions
diff --git a/Tests/RunCMake/Swift/SwiftLibraryModuleCommand-check-stdout.txt b/Tests/RunCMake/Swift/SwiftLibraryModuleCommand-check-stdout.txt
index 85767eb..7e7fc7d 100644
--- a/Tests/RunCMake/Swift/SwiftLibraryModuleCommand-check-stdout.txt
+++ b/Tests/RunCMake/Swift/SwiftLibraryModuleCommand-check-stdout.txt
@@ -1,3 +1,5 @@
.*swiftc(.exe)? .* -parse-as-library -static -emit-module .* -module-name StaticLibrary [^
]*
-.*swiftc(.exe)? .* -parse-as-library -emit-module .* -module-name DynamicLibrary
+.*swiftc(.exe)? .* -parse-as-library -emit-module .* -module-name DynamicLibrary [^
+]*
+.*swiftc(.exe)? .* -j [0-9]* -num-threads [0-9]* -c -module-name Executable
diff --git a/Tests/RunCMake/Swift/SwiftLibraryModuleCommand.cmake b/Tests/RunCMake/Swift/SwiftLibraryModuleCommand.cmake
index 7127751..af4aede 100644
--- a/Tests/RunCMake/Swift/SwiftLibraryModuleCommand.cmake
+++ b/Tests/RunCMake/Swift/SwiftLibraryModuleCommand.cmake
@@ -6,3 +6,7 @@ enable_language(Swift)
add_library(StaticLibrary STATIC L.swift)
add_library(DynamicLibrary SHARED L.swift)
+add_executable(Executable E.swift)
+
+add_dependencies(DynamicLibrary StaticLibrary)
+add_dependencies(Executable DynamicLibrary)