diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-10-09 08:34:47 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-10-15 09:25:12 (GMT) |
commit | 425cd1670fdd40b752af71e5f28952ae4fcec4ac (patch) | |
tree | 5b5538f305e6636f94fa24000b8fb0874b35df43 /Source/cmNinjaTargetGenerator.cxx | |
parent | 0d818632978a450f1afaf687c867e62e885457f7 (diff) | |
download | CMake-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/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 46a6161..f85ea81 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -374,7 +374,6 @@ void cmNinjaTargetGenerator::WriteLanguageRules(const std::string& language) void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) { cmLocalGenerator::RuleVariables vars; - vars.RuleLauncher = "RULE_LAUNCH_COMPILE"; vars.CMTarget = this->GetGeneratorTarget(); vars.Language = lang.c_str(); vars.Source = "$IN_ABS"; @@ -456,6 +455,14 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) ConvertToNinjaPath(this->GetTargetDependInfoPath(lang)), cmLocalGenerator::SHELL); + std::string launcher; + const char* val = this->GetLocalGenerator()->GetRuleLauncher( + this->GetGeneratorTarget(), "RULE_LAUNCH_COMPILE"); + if (val && *val) { + launcher = val; + launcher += " "; + } + if (explicitPP) { // Lookup the explicit preprocessing rule. std::string const ppVar = "CMAKE_" + lang + "_PREPROCESS_SOURCE"; @@ -467,7 +474,6 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) std::string const ppDepfile = "$DEP_FILE"; cmLocalGenerator::RuleVariables ppVars; - ppVars.RuleLauncher = vars.RuleLauncher; ppVars.CMTarget = vars.CMTarget; ppVars.Language = vars.Language; ppVars.Object = "$out"; // for RULE_LAUNCH_COMPILE @@ -496,6 +502,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) for (std::vector<std::string>::iterator i = ppCmds.begin(); i != ppCmds.end(); ++i) { + *i = launcher + *i; this->GetLocalGenerator()->ExpandRuleVariables(*i, ppVars); } @@ -608,6 +615,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) for (std::vector<std::string>::iterator i = compileCmds.begin(); i != compileCmds.end(); ++i) { + *i = launcher + *i; this->GetLocalGenerator()->ExpandRuleVariables(*i, vars); } |