summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-02-26 15:18:43 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-02-26 15:19:21 (GMT)
commit083afc88dbe2816e6abf35267a2be3fcb75a2b7f (patch)
treea597cf57eeff5b5a0ac05ca9526679b58345d33c
parent2c69f8abeed1137891f46fec8448f7ce2b0a62e6 (diff)
parentf292e28b84a8df50a8c4523c04f5e9eacc2ee772 (diff)
downloadCMake-083afc88dbe2816e6abf35267a2be3fcb75a2b7f.zip
CMake-083afc88dbe2816e6abf35267a2be3fcb75a2b7f.tar.gz
CMake-083afc88dbe2816e6abf35267a2be3fcb75a2b7f.tar.bz2
Merge topic 'swift-exe-module-name' into release-3.29
f292e28b84 Swift: Ninja: Pass module name to all swift builds Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !9282
-rw-r--r--Source/cmNinjaTargetGenerator.cxx6
-rw-r--r--Tests/RunCMake/Swift/SwiftLibraryModuleCommand-check-stdout.txt4
-rw-r--r--Tests/RunCMake/Swift/SwiftLibraryModuleCommand.cmake4
3 files changed, 9 insertions, 5 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index a465b08..a88d847 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -2024,11 +2024,9 @@ void cmNinjaTargetGenerator::WriteSwiftObjectBuildStatement(
this->LocalGenerator->AppendFlags(
vars["FLAGS"], { emitModuleFlag, modulePathFlag, moduleFilepath });
objBuild.Outputs.push_back(moduleFilepath);
-
- std::string const moduleNameFlag = "-module-name";
- this->LocalGenerator->AppendFlags(
- vars["FLAGS"], cmStrCat(moduleNameFlag, ' ', moduleName));
}
+ this->LocalGenerator->AppendFlags(vars["FLAGS"],
+ cmStrCat("-module-name ", moduleName));
if (target.GetType() != cmStateEnums::EXECUTABLE) {
std::string const libraryLinkNameFlag = "-module-link-name";
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)