summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-09 08:34:47 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-15 09:25:12 (GMT)
commit425cd1670fdd40b752af71e5f28952ae4fcec4ac (patch)
tree5b5538f305e6636f94fa24000b8fb0874b35df43 /Source/cmNinjaNormalTargetGenerator.cxx
parent0d818632978a450f1afaf687c867e62e885457f7 (diff)
downloadCMake-425cd1670fdd40b752af71e5f28952ae4fcec4ac.zip
CMake-425cd1670fdd40b752af71e5f28952ae4fcec4ac.tar.gz
CMake-425cd1670fdd40b752af71e5f28952ae4fcec4ac.tar.bz2
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.
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index d729114..64c434a 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -168,7 +168,6 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
if (!this->GetGlobalGenerator()->HasRule(ruleName)) {
cmLocalGenerator::RuleVariables vars;
- vars.RuleLauncher = "RULE_LAUNCH_LINK";
vars.CMTarget = this->GetGeneratorTarget();
vars.Language = this->TargetLinkLanguage.c_str();
@@ -238,10 +237,19 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
vars.LanguageCompileFlags = langFlags.c_str();
}
+ std::string launcher;
+ const char* val = this->GetLocalGenerator()->GetRuleLauncher(
+ this->GetGeneratorTarget(), "RULE_LAUNCH_LINK");
+ if (val && *val) {
+ launcher = val;
+ launcher += " ";
+ }
+
// Rule for linking library/executable.
std::vector<std::string> linkCmds = this->ComputeLinkCmd();
for (std::vector<std::string>::iterator i = linkCmds.begin();
i != linkCmds.end(); ++i) {
+ *i = launcher + *i;
this->GetLocalGenerator()->ExpandRuleVariables(*i, vars);
}
{