summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--Source/cmLocalGenerator.cxx18
-rw-r--r--Source/cmLocalGenerator.h16
-rw-r--r--Source/cmLocalNinjaGenerator.cxx18
-rw-r--r--Source/cmLocalNinjaGenerator.h2
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx8
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx13
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx24
-rw-r--r--Source/cmMakefileTargetGenerator.cxx23
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx10
-rw-r--r--Source/cmNinjaTargetGenerator.cxx25
10 files changed, 91 insertions, 66 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 615168d..1c3a97d 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -133,6 +133,13 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg, cmMakefile* makefile)
}
}
+cmRulePlaceholderExpander* cmLocalGenerator::CreateRulePlaceholderExpander()
+ const
+{
+ return new cmRulePlaceholderExpander(this->Compilers, this->VariableMappings,
+ this->CompilerSysroot);
+}
+
cmLocalGenerator::~cmLocalGenerator()
{
cmDeleteAll(this->GeneratorTargets);
@@ -561,17 +568,6 @@ cmState::Snapshot cmLocalGenerator::GetStateSnapshot() const
return this->Makefile->GetStateSnapshot();
}
-void cmLocalGenerator::ExpandRuleVariables(cmOutputConverter* outputConverter,
- std::string& s,
- const RuleVariables& replaceValues)
-{
- cmRulePlaceholderExpander rulePlaceholderExpander(
- this->Compilers, this->VariableMappings, this->CompilerSysroot);
- rulePlaceholderExpander.SetTargetImpLib(this->TargetImplib);
- rulePlaceholderExpander.ExpandRuleVariables(outputConverter, s,
- replaceValues);
-}
-
const char* cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target,
const std::string& prop)
{
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 6f8426d..055e1a9 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -24,6 +24,7 @@ class cmComputeLinkInformation;
class cmCustomCommandGenerator;
class cmGeneratorTarget;
class cmGlobalGenerator;
+class cmRulePlaceholderExpander;
class cmMakefile;
class cmSourceFile;
class cmLinkLineComputer;
@@ -85,6 +86,8 @@ public:
return this->GlobalGenerator;
}
+ virtual cmRulePlaceholderExpander* CreateRulePlaceholderExpander() const;
+
std::string GetLinkLibsCMP0065(std::string const& linkLanguage,
cmGeneratorTarget& tgt) const;
@@ -218,10 +221,6 @@ public:
// preprocessed files and assembly files.
void GetIndividualFileTargets(std::vector<std::string>&) {}
- struct RuleVariables : cmRulePlaceholderExpander::RuleVariables
- {
- };
-
/**
* Get the relative path from the generator output directory to a
* per-target support directory.
@@ -315,11 +314,6 @@ public:
void CreateEvaluationFileOutputs(const std::string& config);
void ProcessEvaluationFiles(std::vector<std::string>& generatedFiles);
- // Expand rule variables in CMake of the type found in language rules
- void ExpandRuleVariables(cmOutputConverter* outputConverter,
- std::string& string,
- const RuleVariables& replaceValues);
-
const char* GetRuleLauncher(cmGeneratorTarget* target,
const std::string& prop);
@@ -362,10 +356,6 @@ protected:
bool EmitUniversalBinaryFlags;
- // Hack for ExpandRuleVariable until object-oriented version is
- // committed.
- std::string TargetImplib;
-
KWIML_INT_uint64_t BackwardsCompatibility;
bool BackwardsCompatibilityFinal;
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 += " ";
}
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index 56aa9bf..95d8eb8 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -42,6 +42,8 @@ public:
void Generate() CM_OVERRIDE;
+ cmRulePlaceholderExpander* CreateRulePlaceholderExpander() const CM_OVERRIDE;
+
std::string GetTargetDirectory(cmGeneratorTarget const* target) const
CM_OVERRIDE;
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 6906cbf..f30414c 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -14,6 +14,7 @@
#include "cmMakefile.h"
#include "cmMakefileTargetGenerator.h"
#include "cmOutputConverter.h"
+#include "cmRulePlaceholderExpander.h"
#include "cmSourceFile.h"
#include "cmState.h"
#include "cmSystemTools.h"
@@ -945,6 +946,9 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
*content << dir;
}
+ CM_AUTO_PTR<cmRulePlaceholderExpander> rulePlaceholderExpander(
+ this->CreateRulePlaceholderExpander());
+
// Add each command line to the set of commands.
std::vector<std::string> commands1;
std::string currentBinDir = this->GetCurrentBinaryDirectory();
@@ -988,7 +992,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
if (val && *val) {
// Expand rules in the empty string. It may insert the launcher and
// perform replacements.
- RuleVariables vars;
+ cmRulePlaceholderExpander::RuleVariables vars;
vars.CMTargetName = target->GetName().c_str();
vars.CMTargetType = cmState::GetTargetTypeName(target->GetType());
std::string output;
@@ -1006,7 +1010,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
launcher = val;
launcher += " ";
- this->ExpandRuleVariables(this, launcher, vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this, launcher, vars);
if (!launcher.empty()) {
launcher += " ";
}
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index fafff01..7eca0a8 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -11,6 +11,7 @@
#include "cmMakefile.h"
#include "cmOSXBundleGenerator.h"
#include "cmOutputConverter.h"
+#include "cmRulePlaceholderExpander.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -331,7 +332,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
std::string manifests = this->GetManifests();
- cmLocalGenerator::RuleVariables vars;
+ cmRulePlaceholderExpander::RuleVariables vars;
vars.CMTargetName = this->GeneratorTarget->GetName().c_str();
vars.CMTargetType =
cmState::GetTargetTypeName(this->GeneratorTarget->GetType());
@@ -393,15 +394,17 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
launcher += " ";
}
+ CM_AUTO_PTR<cmRulePlaceholderExpander> rulePlaceholderExpander(
+ this->LocalGenerator->CreateRulePlaceholderExpander());
+
// Expand placeholders in the commands.
- this->LocalGenerator->TargetImplib = targetOutPathImport;
+ rulePlaceholderExpander->SetTargetImpLib(targetOutPathImport);
for (std::vector<std::string>::iterator i = real_link_commands.begin();
i != real_link_commands.end(); ++i) {
*i = launcher + *i;
- this->LocalGenerator->ExpandRuleVariables(this->LocalGenerator, *i,
- vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, *i,
+ vars);
}
- this->LocalGenerator->TargetImplib = "";
// Restore path conversion to normal shells.
this->LocalGenerator->SetLinkScriptShell(false);
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 1ae34d6..00a9100 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -11,6 +11,7 @@
#include "cmMakefile.h"
#include "cmOSXBundleGenerator.h"
#include "cmOutputConverter.h"
+#include "cmRulePlaceholderExpander.h"
#include "cmState.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -520,7 +521,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
std::string manifests = this->GetManifests();
- cmLocalGenerator::RuleVariables vars;
+ cmRulePlaceholderExpander::RuleVariables vars;
vars.TargetPDB = targetOutPathPDB.c_str();
// Setup the target version.
@@ -606,8 +607,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
launcher += " ";
}
+ CM_AUTO_PTR<cmRulePlaceholderExpander> rulePlaceholderExpander(
+ this->LocalGenerator->CreateRulePlaceholderExpander());
// Construct the main link rule and expand placeholders.
- this->LocalGenerator->TargetImplib = targetOutPathImport;
+ rulePlaceholderExpander->SetTargetImpLib(targetOutPathImport);
if (useArchiveRules) {
// Construct the individual object list strings.
std::vector<std::string> object_strings;
@@ -621,8 +624,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
archiveCreateCommands.begin();
i != archiveCreateCommands.end(); ++i) {
std::string cmd = launcher + *i;
- this->LocalGenerator->ExpandRuleVariables(this->LocalGenerator, cmd,
- vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator,
+ cmd, vars);
real_link_commands.push_back(cmd);
}
}
@@ -633,8 +636,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
archiveAppendCommands.begin();
i != archiveAppendCommands.end(); ++i) {
std::string cmd = launcher + *i;
- this->LocalGenerator->ExpandRuleVariables(this->LocalGenerator, cmd,
- vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator,
+ cmd, vars);
real_link_commands.push_back(cmd);
}
}
@@ -644,8 +647,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
archiveFinishCommands.begin();
i != archiveFinishCommands.end(); ++i) {
std::string cmd = launcher + *i;
- this->LocalGenerator->ExpandRuleVariables(this->LocalGenerator, cmd,
- vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, cmd,
+ vars);
// If there is no ranlib the command will be ":". Skip it.
if (!cmd.empty() && cmd[0] != ':') {
real_link_commands.push_back(cmd);
@@ -668,11 +671,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
for (std::vector<std::string>::iterator i = real_link_commands.begin();
i != real_link_commands.end(); ++i) {
*i = launcher + *i;
- this->LocalGenerator->ExpandRuleVariables(this->LocalGenerator, *i,
- vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, *i,
+ vars);
}
}
- this->LocalGenerator->TargetImplib = "";
// Restore path conversion to normal shells.
this->LocalGenerator->SetLinkScriptShell(false);
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 9492a61..cbfe850 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -18,6 +18,7 @@
#include "cmMakefileLibraryTargetGenerator.h"
#include "cmMakefileUtilityTargetGenerator.h"
#include "cmOutputConverter.h"
+#include "cmRulePlaceholderExpander.h"
#include "cmSourceFile.h"
#include "cmState.h"
#include "cmSystemTools.h"
@@ -543,7 +544,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
targetOutPathCompilePDB[targetOutPathCompilePDB.size() - 1] = '/';
}
}
- cmLocalGenerator::RuleVariables vars;
+ cmRulePlaceholderExpander::RuleVariables vars;
vars.RuleLauncher = "RULE_LAUNCH_COMPILE";
vars.CMTargetName = this->GeneratorTarget->GetName().c_str();
vars.CMTargetType =
@@ -589,6 +590,9 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
bool const lang_has_assembly = lang_has_preprocessor;
bool const lang_can_export_cmds = lang_has_preprocessor;
+ CM_AUTO_PTR<cmRulePlaceholderExpander> rulePlaceholderExpander(
+ this->LocalGenerator->CreateRulePlaceholderExpander());
+
// Construct the compile rules.
{
std::string compileRuleVar = "CMAKE_";
@@ -602,8 +606,9 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
if (this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS") &&
lang_can_export_cmds && compileCommands.size() == 1) {
std::string compileCommand = compileCommands[0];
- this->LocalGenerator->ExpandRuleVariables(this->LocalGenerator,
- compileCommand, vars);
+
+ rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator,
+ compileCommand, vars);
std::string workingDirectory = cmSystemTools::CollapseFullPath(
this->LocalGenerator->GetCurrentBinaryDirectory());
compileCommand.replace(compileCommand.find(langFlags), langFlags.size(),
@@ -662,8 +667,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
// Expand placeholders in the commands.
for (std::vector<std::string>::iterator i = compileCommands.begin();
i != compileCommands.end(); ++i) {
- this->LocalGenerator->ExpandRuleVariables(this->LocalGenerator, *i,
- vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, *i,
+ vars);
}
// Change the command working directory to the local build tree.
@@ -726,8 +731,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
// Expand placeholders in the commands.
for (std::vector<std::string>::iterator i = preprocessCommands.begin();
i != preprocessCommands.end(); ++i) {
- this->LocalGenerator->ExpandRuleVariables(this->LocalGenerator, *i,
- vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator,
+ *i, vars);
}
this->LocalGenerator->CreateCDCommand(
@@ -774,8 +779,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
// Expand placeholders in the commands.
for (std::vector<std::string>::iterator i = assemblyCommands.begin();
i != assemblyCommands.end(); ++i) {
- this->LocalGenerator->ExpandRuleVariables(this->LocalGenerator, *i,
- vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator,
+ *i, vars);
}
this->LocalGenerator->CreateCDCommand(
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.
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index c718ad4..1ac6cd4 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -14,6 +14,7 @@
#include "cmNinjaNormalTargetGenerator.h"
#include "cmNinjaUtilityTargetGenerator.h"
#include "cmOutputConverter.h"
+#include "cmRulePlaceholderExpander.h"
#include "cmSourceFile.h"
#include "cmState.h"
#include "cmSystemTools.h"
@@ -373,7 +374,7 @@ void cmNinjaTargetGenerator::WriteLanguageRules(const std::string& language)
void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
{
- cmLocalGenerator::RuleVariables vars;
+ cmRulePlaceholderExpander::RuleVariables vars;
vars.CMTargetName = this->GetGeneratorTarget()->GetName().c_str();
vars.CMTargetType =
cmState::GetTargetTypeName(this->GetGeneratorTarget()->GetType());
@@ -453,6 +454,9 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
vars.Flags = flags.c_str();
vars.DependencyFile = depfile.c_str();
+ CM_AUTO_PTR<cmRulePlaceholderExpander> rulePlaceholderExpander(
+ this->GetLocalGenerator()->CreateRulePlaceholderExpander());
+
std::string const tdi = this->GetLocalGenerator()->ConvertToOutputFormat(
ConvertToNinjaPath(this->GetTargetDependInfoPath(lang)),
cmLocalGenerator::SHELL);
@@ -475,7 +479,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
std::string const ppDeptype = ""; // no deps= for multiple outputs
std::string const ppDepfile = "$DEP_FILE";
- cmLocalGenerator::RuleVariables ppVars;
+ cmRulePlaceholderExpander::RuleVariables ppVars;
ppVars.CMTargetName = vars.CMTargetName;
ppVars.CMTargetType = vars.CMTargetType;
ppVars.Language = vars.Language;
@@ -506,8 +510,8 @@ 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(this->GetLocalGenerator(),
- *i, ppVars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->GetLocalGenerator(),
+ *i, ppVars);
}
// Run CMake dependency scanner on preprocessed output.
@@ -620,8 +624,8 @@ 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(this->GetLocalGenerator(),
- *i, vars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->GetLocalGenerator(), *i,
+ vars);
}
std::string cmdLine =
@@ -974,7 +978,7 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand(
return;
}
- cmLocalGenerator::RuleVariables compileObjectVars;
+ cmRulePlaceholderExpander::RuleVariables compileObjectVars;
compileObjectVars.Language = language.c_str();
std::string escapedSourceFileName = sourceFileName;
@@ -1006,10 +1010,13 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand(
std::vector<std::string> compileCmds;
cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
+ CM_AUTO_PTR<cmRulePlaceholderExpander> rulePlaceholderExpander(
+ this->GetLocalGenerator()->CreateRulePlaceholderExpander());
+
for (std::vector<std::string>::iterator i = compileCmds.begin();
i != compileCmds.end(); ++i) {
- this->GetLocalGenerator()->ExpandRuleVariables(this->GetLocalGenerator(),
- *i, compileObjectVars);
+ rulePlaceholderExpander->ExpandRuleVariables(this->GetLocalGenerator(), *i,
+ compileObjectVars);
}
std::string cmdLine =