summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2019-01-16 19:42:10 (GMT)
committerSaleem Abdulrasool <compnerd@compnerd.org>2019-01-24 05:21:07 (GMT)
commitde13c55d74e0e95aa3799ba132db668212721776 (patch)
tree33ee7d3b6758b92114057d69c7474566b599e891 /Source/cmNinjaTargetGenerator.cxx
parenta5789224674999ed206464fa7cea62ae31e3dc67 (diff)
downloadCMake-de13c55d74e0e95aa3799ba132db668212721776.zip
CMake-de13c55d74e0e95aa3799ba132db668212721776.tar.gz
CMake-de13c55d74e0e95aa3799ba132db668212721776.tar.bz2
Ninja: support `SWIFT_MODULE_NAME` property
Add a new `SWIFT_MODULE_NAME` property that defaults to the target name. This can be adjusted via `set_target_properties`. This is needed as otherwise, the first source file determines the module name. Issue: #18800
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index c959a04..edb0ef3 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -919,7 +919,12 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
}
vars["SWIFT_AUXILIARY_SOURCES"] = aux_sources;
- vars["SWIFT_MODULE_NAME"] = this->GeneratorTarget->GetName();
+ if (const char* name =
+ this->GeneratorTarget->GetProperty("SWIFT_MODULE_NAME")) {
+ vars["SWIFT_MODULE_NAME"] = name;
+ } else {
+ vars["SWIFT_MODULE_NAME"] = this->GeneratorTarget->GetName();
+ }
}
if (!this->NeedDepTypeMSVC(language)) {