summaryrefslogtreecommitdiff
path: root/Source/cmLocalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-09-11 14:04:33 -0400
committerBrad King <brad.king@kitware.com>2018-09-11 14:18:10 -0400
commit3e125c0c017e346768f9882882c31b81cc07940f (patch)
tree2fe8beb8807089ec49d968823c7e9d3b503cf1fe /Source/cmLocalNinjaGenerator.cxx
parent344eb9c8dc3b16a524729cb66ad25fc1c127a02c (diff)
downloadcmake-3e125c0c017e346768f9882882c31b81cc07940f.tar.gz
Ninja,Makefile: Drop extra space after RULE_LAUNCH_CUSTOM value
The Ninja and Makefile generators were adding a space to the value both before and after expanding rule variables. Only the latter is needed. While at it, revise some outdated comments since the rule variable expansion is no longer responsible for inserting the launcher. Suggested-by: Mate Pek <mate.pek@gmail.com> Fixes: #18340
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r--Source/cmLocalNinjaGenerator.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 360f73da58..eb31478800 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -564,8 +564,7 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
return std::string();
}
- // Expand rules in the empty string. It may insert the launcher and
- // perform replacements.
+ // Expand rule variables referenced in the given launcher command.
cmRulePlaceholderExpander::RuleVariables vars;
std::string output;
@@ -580,12 +579,10 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
}
vars.Output = output.c_str();
- std::string launcher = property_value;
- launcher += " ";
-
std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
this->CreateRulePlaceholderExpander());
+ std::string launcher = property_value;
rulePlaceholderExpander->ExpandRuleVariables(this, launcher, vars);
if (!launcher.empty()) {
launcher += " ";