summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-09 08:34:50 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-15 09:25:12 (GMT)
commitb59b6dd9d27de7839c7b23a3094db33298038896 (patch)
tree2b36fbb568918ef952f0f59beaa15363f09b400f /Source/cmNinjaNormalTargetGenerator.cxx
parentbdddd4234e977f65ee7df8adcd3888706dfd0dda (diff)
downloadCMake-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/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 3adc068..b28b19a 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -15,6 +15,7 @@
#include "cmNinjaTypes.h"
#include "cmOSXBundleGenerator.h"
#include "cmOutputConverter.h"
+#include "cmRulePlaceholderExpander.h"
#include "cmSourceFile.h"
#include "cmState.h"
#include "cmSystemTools.h"
@@ -167,7 +168,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
std::string rspcontent;
if (!this->GetGlobalGenerator()->HasRule(ruleName)) {
- cmLocalGenerator::RuleVariables vars;
+ cmRulePlaceholderExpander::RuleVariables vars;
vars.CMTargetName = this->GetGeneratorTarget()->GetName().c_str();
vars.CMTargetType =
cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType());
@@ -248,13 +249,16 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
launcher += " ";
}
+ CM_AUTO_PTR<cmRulePlaceholderExpander> rulePlaceholderExpander(
+ this->GetLocalGenerator()->CreateRulePlaceholderExpander());
+
// 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(this->GetLocalGenerator(),
- *i, vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->GetLocalGenerator(),
+ *i, vars);
}
{
// If there is no ranlib the command will be ":". Skip it.