summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2019-02-18 19:13:39 (GMT)
committerSaleem Abdulrasool <compnerd@compnerd.org>2019-02-18 19:15:47 (GMT)
commitc048cb75fcee6b31cfacdce714b343c6623f5c9c (patch)
treeb40ae8046c037d86f4758a85935b1af9d87f00bd /Source/cmNinjaTargetGenerator.cxx
parent75b45956e044701c0ebe6dbc433f629e0558bdb8 (diff)
downloadCMake-c048cb75fcee6b31cfacdce714b343c6623f5c9c.zip
CMake-c048cb75fcee6b31cfacdce714b343c6623f5c9c.tar.gz
CMake-c048cb75fcee6b31cfacdce714b343c6623f5c9c.tar.bz2
Ninja: add properties for Swift partial module and doc
When building a swift object, we emit a partial swiftmodule and swiftdoc that must be merged at the end. However, in order to do that, we need to enumerate the swiftmodules and swiftdocs. As a result, the path must be known to CMake. Rather than hardcoding the rules into CMake, create a source property that we can query. This will allow us to create a final placeholder to emit the merge rule. Issue: #18800
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 8d2586d..6013cd0 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -455,6 +455,8 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
vars.SwiftAuxiliarySources = "$SWIFT_AUXILIARY_SOURCES";
vars.SwiftModuleName = "$SWIFT_MODULE_NAME";
vars.SwiftLibraryName = "$SWIFT_LIBRARY_NAME";
+ vars.SwiftPartialModule = "$SWIFT_PARTIAL_MODULE";
+ vars.SwiftPartialDoc = "$SWIFT_PARTIAL_DOC";
}
// For some cases we do an explicit preprocessor invocation.
@@ -945,6 +947,18 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
cmGeneratorTarget::Names targetNames =
this->GeneratorTarget->GetLibraryNames(this->GetConfigName());
vars["SWIFT_LIBRARY_NAME"] = targetNames.Base;
+
+ if (const char* partial = source->GetProperty("SWIFT_PARTIAL_MODULE")) {
+ vars["SWIFT_PARTIAL_MODULE"] = partial;
+ } else {
+ vars["SWIFT_PARTIAL_MODULE"] = objectFileName + ".swiftmodule";
+ }
+
+ if (const char* partial = source->GetProperty("SWIFT_PARTIAL_DOC")) {
+ vars["SWIFT_PARTIAL_DOC"] = partial;
+ } else {
+ vars["SWIFT_PARTIAL_DOC"] = objectFileName + ".swiftdoc";
+ }
}
if (!this->NeedDepTypeMSVC(language)) {