summaryrefslogtreecommitdiffstats
path: root/Source
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 /Source
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 'Source')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx6
1 files changed, 2 insertions, 4 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";