diff options
author | Brad King <brad.king@kitware.com> | 2019-05-22 14:27:19 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-22 14:28:00 (GMT) |
commit | aefd424b6b2f5b630f9a511cfadd6b07228656c1 (patch) | |
tree | 50f10a9bd7398c40cbca1e5376604573a4d21ef8 /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | f83f29dbaa254053ac7fe2cc0e6403908fc04ac9 (diff) | |
parent | 62381effba418cdccff0b18f234e3a307446d635 (diff) | |
download | CMake-aefd424b6b2f5b630f9a511cfadd6b07228656c1.zip CMake-aefd424b6b2f5b630f9a511cfadd6b07228656c1.tar.gz CMake-aefd424b6b2f5b630f9a511cfadd6b07228656c1.tar.bz2 |
Merge topic 'swift-debug-variant'
62381effba Ninja,Swift: reuse `SWIFT_MODULE_NAME` for `SWIFT_MODULE`
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3343
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 95ffb65..b4a6a5d 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -814,10 +814,15 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() return targetNames.Base; }(); - vars["SWIFT_MODULE"] = [this]() -> std::string { - cmGeneratorTarget::Names targetNames = - this->GetGeneratorTarget()->GetLibraryNames(this->GetConfigName()); + vars["SWIFT_MODULE_NAME"] = [this]() -> std::string { + if (const char* name = + this->GetGeneratorTarget()->GetProperty("Swift_MODULE_NAME")) { + return name; + } + return this->GetGeneratorTarget()->GetName(); + }(); + vars["SWIFT_MODULE"] = [this](const std::string& module) -> std::string { std::string directory = this->GetLocalGenerator()->GetCurrentBinaryDirectory(); if (const char* prop = this->GetGeneratorTarget()->GetProperty( @@ -825,7 +830,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() directory = prop; } - std::string name = targetNames.Base + ".swiftmodule"; + std::string name = module + ".swiftmodule"; if (const char* prop = this->GetGeneratorTarget()->GetProperty("Swift_MODULE")) { name = prop; @@ -834,15 +839,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() return this->GetLocalGenerator()->ConvertToOutputFormat( this->ConvertToNinjaPath(directory + "/" + name), cmOutputConverter::SHELL); - }(); - - vars["SWIFT_MODULE_NAME"] = [this]() -> std::string { - if (const char* name = - this->GetGeneratorTarget()->GetProperty("Swift_MODULE_NAME")) { - return name; - } - return this->GetGeneratorTarget()->GetName(); - }(); + }(vars["SWIFT_MODULE_NAME"]); vars["SWIFT_OUTPUT_FILE_MAP"] = this->GetLocalGenerator()->ConvertToOutputFormat( |