Merge topic 'rule-launch-custom-extra-space'

3e125c0c01 Ninja,Makefile: Drop extra space after RULE_LAUNCH_CUSTOM value

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2372
This commit is contained in:
Brad King 2018-09-12 13:39:41 +00:00 committed by Kitware Robot
commit 42212f7539
2 changed files with 3 additions and 8 deletions

View File

@ -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 += " ";

View File

@ -967,8 +967,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
// Short-circuit if there is no launcher.
const char* val = this->GetRuleLauncher(target, "RULE_LAUNCH_CUSTOM");
if (val && *val) {
// 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;
vars.CMTargetName = target->GetName().c_str();
vars.CMTargetType = cmState::GetTargetTypeName(target->GetType());
@ -986,7 +985,6 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
vars.Output = output.c_str();
launcher = val;
launcher += " ";
rulePlaceholderExpander->ExpandRuleVariables(this, launcher, vars);
if (!launcher.empty()) {
launcher += " ";