diff options
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/cmRulePlaceholderExpander.cxx | 5 | ||||
-rw-r--r-- | Source/cmRulePlaceholderExpander.h | 1 |
3 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 5013be5..c959a04 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -433,6 +433,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) vars.ObjectFileDir = "$OBJECT_FILE_DIR"; if (lang == "Swift") { vars.SwiftAuxiliarySources = "$SWIFT_AUXILIARY_SOURCES"; + vars.SwiftModuleName = "$SWIFT_MODULE_NAME"; } // For some cases we do an explicit preprocessor invocation. @@ -904,9 +905,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( vars["FLAGS"] = this->ComputeFlagsForObject(source, language); vars["DEFINES"] = this->ComputeDefines(source, language); vars["INCLUDES"] = this->ComputeIncludes(source, language); - // The swift compiler needs all the sources besides the one being compiled in - // order to do the type checking. List all these "auxiliary" sources. if (language == "Swift") { + // The swift compiler needs all the sources besides the one being compiled + // in order to do the type checking. List all these "auxiliary" sources. std::string aux_sources; cmGeneratorTarget::KindedSources const& sources = this->GeneratorTarget->GetKindedSources(this->GetConfigName()); @@ -917,6 +918,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( aux_sources += " " + this->GetSourceFilePath(src.Source.Value); } vars["SWIFT_AUXILIARY_SOURCES"] = aux_sources; + + vars["SWIFT_MODULE_NAME"] = this->GeneratorTarget->GetName(); } if (!this->NeedDepTypeMSVC(language)) { diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx index 4b74ff0..c3e8ff5 100644 --- a/Source/cmRulePlaceholderExpander.cxx +++ b/Source/cmRulePlaceholderExpander.cxx @@ -167,6 +167,11 @@ std::string cmRulePlaceholderExpander::ExpandRuleVariable( return replaceValues.SwiftAuxiliarySources; } } + if (replaceValues.SwiftModuleName) { + if (variable == "SWIFT_MODULE_NAME") { + return replaceValues.SwiftModuleName; + } + } if (variable == "TARGET_SONAME" || variable == "SONAME_FLAG" || variable == "TARGET_INSTALLNAME_DIR") { // All these variables depend on TargetSOName diff --git a/Source/cmRulePlaceholderExpander.h b/Source/cmRulePlaceholderExpander.h index a936747..7aa63db 100644 --- a/Source/cmRulePlaceholderExpander.h +++ b/Source/cmRulePlaceholderExpander.h @@ -59,6 +59,7 @@ public: const char* DependencyFile; const char* FilterPrefix; const char* SwiftAuxiliarySources; + const char* SwiftModuleName; }; // Expand rule variables in CMake of the type found in language rules |