cmLocalGenerator: Remove the launcher from RuleVariables

This one is not like the others as it doesn't participate in
substitutions.  Keep ExpandRuleVariables doing only one thing and make
callers responsible for inserting a launcher prefix, simplifying the
code all-around.

Remove now-obsolete InsertRuleLauncher method.
This commit is contained in:
Stephen Kelly
2016-10-09 10:34:47 +02:00
parent 0d81863297
commit 425cd1670f
9 changed files with 57 additions and 44 deletions
+10 -1
View File
@@ -332,7 +332,6 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
std::string manifests = this->GetManifests();
cmLocalGenerator::RuleVariables vars;
vars.RuleLauncher = "RULE_LAUNCH_LINK";
vars.CMTarget = this->GeneratorTarget;
vars.Language = linkLanguage.c_str();
vars.Objects = buildObjs.c_str();
@@ -383,10 +382,20 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
real_link_commands.push_back(cmakeCommand);
}
std::string launcher;
const char* val = this->LocalGenerator->GetRuleLauncher(
this->GeneratorTarget, "RULE_LAUNCH_LINK");
if (val && *val) {
launcher = val;
launcher += " ";
}
// Expand placeholders in the commands.
this->LocalGenerator->TargetImplib = targetOutPathImport;
for (std::vector<std::string>::iterator i = real_link_commands.begin();
i != real_link_commands.end(); ++i) {
*i = launcher + *i;
this->LocalGenerator->ExpandRuleVariables(*i, vars);
}
this->LocalGenerator->TargetImplib = "";