Browse Source

Merge topic 'swift'

de13c55d74 Ninja: support `SWIFT_MODULE_NAME` property

Acked-by: Kitware Robot <[email protected]>
Merge-request: !2850
Brad King 6 years ago
parent
commit
15bc4a25e5
1 changed files with 6 additions and 1 deletions
  1. 6 1
      Source/cmNinjaTargetGenerator.cxx

+ 6 - 1
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)) {