diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-10-09 08:34:50 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-10-15 09:25:12 (GMT) |
commit | b59b6dd9d27de7839c7b23a3094db33298038896 (patch) | |
tree | 2b36fbb568918ef952f0f59beaa15363f09b400f /Source/cmLocalNinjaGenerator.cxx | |
parent | bdddd4234e977f65ee7df8adcd3888706dfd0dda (diff) | |
download | CMake-b59b6dd9d27de7839c7b23a3094db33298038896.zip CMake-b59b6dd9d27de7839c7b23a3094db33298038896.tar.gz CMake-b59b6dd9d27de7839c7b23a3094db33298038896.tar.bz2 |
cmRulePlaceholderExpander: Port clients to direct-use
Add a factory function to cmLocalGenerator so that variableMappings can
be provided from it, and so that Ninja can always have a hard-coded
TargetImpLib.
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmLocalNinjaGenerator.cxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 05596f8..1863376 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -10,6 +10,7 @@ #include "cmGlobalNinjaGenerator.h" #include "cmMakefile.h" #include "cmNinjaTargetGenerator.h" +#include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" #include "cmState.h" #include "cmSystemTools.h" @@ -27,11 +28,19 @@ cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmGlobalGenerator* gg, : cmLocalCommonGenerator(gg, mf, mf->GetState()->GetBinaryDirectory()) , HomeRelativeOutputPath("") { - this->TargetImplib = "$TARGET_IMPLIB"; } // Virtual public methods. +cmRulePlaceholderExpander* +cmLocalNinjaGenerator::CreateRulePlaceholderExpander() const +{ + cmRulePlaceholderExpander* ret = new cmRulePlaceholderExpander( + this->Compilers, this->VariableMappings, this->CompilerSysroot); + ret->SetTargetImpLib("$TARGET_IMPLIB"); + return ret; +} + cmLocalNinjaGenerator::~cmLocalNinjaGenerator() { } @@ -477,7 +486,7 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher( // Expand rules in the empty string. It may insert the launcher and // perform replacements. - RuleVariables vars; + cmRulePlaceholderExpander::RuleVariables vars; std::string output; const std::vector<std::string>& outputs = ccg.GetOutputs(); @@ -494,7 +503,10 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher( std::string launcher = property_value; launcher += " "; - this->ExpandRuleVariables(this, launcher, vars); + CM_AUTO_PTR<cmRulePlaceholderExpander> rulePlaceholderExpander( + this->CreateRulePlaceholderExpander()); + + rulePlaceholderExpander->ExpandRuleVariables(this, launcher, vars); if (!launcher.empty()) { launcher += " "; } |