diff options
author | Brad King <brad.king@kitware.com> | 2019-01-21 12:52:34 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-21 12:52:40 (GMT) |
commit | 9ea2f0eb948548aab2fc865d62a658e0c78e90f9 (patch) | |
tree | df6bf0e667432b6164afa2724966ae3471af3c62 | |
parent | 4dba5d6ce251257259874bce394b2fba954e200c (diff) | |
parent | 0ffe8f8844bb74e785feec84e4871ec139185625 (diff) | |
download | CMake-9ea2f0eb948548aab2fc865d62a658e0c78e90f9.zip CMake-9ea2f0eb948548aab2fc865d62a658e0c78e90f9.tar.gz CMake-9ea2f0eb948548aab2fc865d62a658e0c78e90f9.tar.bz2 |
Merge topic 'swift-module-name'
0ffe8f8844 Ninja: support `SWIFT_MODULE_NAME` property
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2813
-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 |