genex: remove the need for backtraces

Rather than making dummy backtraces and passing them around, just make
backtraces optional.
This commit is contained in:
Ben Boeckel 2014-05-23 14:59:11 -04:00
parent efc205695d
commit a08292059e
20 changed files with 117 additions and 125 deletions

View File

@ -33,7 +33,7 @@ cmCustomCommand::cmCustomCommand(const cmCustomCommand& r):
WorkingDirectory(r.WorkingDirectory), WorkingDirectory(r.WorkingDirectory),
EscapeAllowMakeVars(r.EscapeAllowMakeVars), EscapeAllowMakeVars(r.EscapeAllowMakeVars),
EscapeOldStyle(r.EscapeOldStyle), EscapeOldStyle(r.EscapeOldStyle),
Backtrace(new cmListFileBacktrace(*r.Backtrace)) Backtrace(r.Backtrace)
{ {
} }
@ -54,11 +54,7 @@ cmCustomCommand& cmCustomCommand::operator=(cmCustomCommand const& r)
this->EscapeAllowMakeVars = r.EscapeAllowMakeVars; this->EscapeAllowMakeVars = r.EscapeAllowMakeVars;
this->EscapeOldStyle = r.EscapeOldStyle; this->EscapeOldStyle = r.EscapeOldStyle;
this->ImplicitDepends = r.ImplicitDepends; this->ImplicitDepends = r.ImplicitDepends;
this->Backtrace = r.Backtrace;
cmsys::auto_ptr<cmListFileBacktrace>
newBacktrace(new cmListFileBacktrace(*r.Backtrace));
delete this->Backtrace;
this->Backtrace = newBacktrace.release();
return *this; return *this;
} }
@ -77,21 +73,19 @@ cmCustomCommand::cmCustomCommand(cmMakefile const* mf,
Comment(comment?comment:""), Comment(comment?comment:""),
WorkingDirectory(workingDirectory?workingDirectory:""), WorkingDirectory(workingDirectory?workingDirectory:""),
EscapeAllowMakeVars(false), EscapeAllowMakeVars(false),
EscapeOldStyle(true), EscapeOldStyle(true)
Backtrace(new cmListFileBacktrace)
{ {
this->EscapeOldStyle = true; this->EscapeOldStyle = true;
this->EscapeAllowMakeVars = false; this->EscapeAllowMakeVars = false;
if(mf) if(mf)
{ {
*this->Backtrace = mf->GetBacktrace(); this->Backtrace = mf->GetBacktrace();
} }
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmCustomCommand::~cmCustomCommand() cmCustomCommand::~cmCustomCommand()
{ {
delete this->Backtrace;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -166,7 +160,7 @@ void cmCustomCommand::SetEscapeAllowMakeVars(bool b)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmListFileBacktrace const& cmCustomCommand::GetBacktrace() const cmListFileBacktrace const& cmCustomCommand::GetBacktrace() const
{ {
return *this->Backtrace; return this->Backtrace;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -13,8 +13,8 @@
#define cmCustomCommand_h #define cmCustomCommand_h
#include "cmStandardIncludes.h" #include "cmStandardIncludes.h"
#include "cmListFileCache.h"
class cmMakefile; class cmMakefile;
class cmListFileBacktrace;
/** \class cmCustomCommand /** \class cmCustomCommand
* \brief A class to encapsulate a custom command * \brief A class to encapsulate a custom command
@ -88,7 +88,7 @@ private:
std::string WorkingDirectory; std::string WorkingDirectory;
bool EscapeAllowMakeVars; bool EscapeAllowMakeVars;
bool EscapeOldStyle; bool EscapeOldStyle;
cmListFileBacktrace* Backtrace; cmListFileBacktrace Backtrace;
ImplicitDependsList ImplicitDepends; ImplicitDependsList ImplicitDepends;
}; };

View File

@ -21,7 +21,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(
cmCustomCommand const& cc, const std::string& config, cmMakefile* mf): cmCustomCommand const& cc, const std::string& config, cmMakefile* mf):
CC(cc), Config(config), Makefile(mf), LG(mf->GetLocalGenerator()), CC(cc), Config(config), Makefile(mf), LG(mf->GetLocalGenerator()),
OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()), OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()),
GE(new cmGeneratorExpression(cc.GetBacktrace())), DependsDone(false) GE(new cmGeneratorExpression(&cc.GetBacktrace())), DependsDone(false)
{ {
} }

View File

@ -377,8 +377,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
const char *propName = "INTERFACE_INCLUDE_DIRECTORIES"; const char *propName = "INTERFACE_INCLUDE_DIRECTORIES";
const char *input = target->GetProperty(propName); const char *input = target->GetProperty(propName);
cmListFileBacktrace lfbt; cmGeneratorExpression ge;
cmGeneratorExpression ge(lfbt);
std::string dirs = cmGeneratorExpression::Preprocess( std::string dirs = cmGeneratorExpression::Preprocess(
tei->InterfaceIncludeDirectories, tei->InterfaceIncludeDirectories,

View File

@ -57,10 +57,9 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
return std::string(); return std::string();
} }
cmListFileBacktrace lfbt; cmGeneratorExpression ge;
cmGeneratorExpression ge(lfbt);
cmGeneratorExpressionDAGChecker dagChecker(lfbt, cmGeneratorExpressionDAGChecker dagChecker(
tgt->GetName(), tgt->GetName(),
propName, 0, 0); propName, 0, 0);

View File

@ -3272,11 +3272,11 @@ void cmFileCommand::AddEvaluationFile(const std::string &inputName,
{ {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression outputGe(lfbt); cmGeneratorExpression outputGe(&lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> outputCge cmsys::auto_ptr<cmCompiledGeneratorExpression> outputCge
= outputGe.Parse(outputExpr); = outputGe.Parse(outputExpr);
cmGeneratorExpression conditionGe(lfbt); cmGeneratorExpression conditionGe(&lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> conditionCge cmsys::auto_ptr<cmCompiledGeneratorExpression> conditionCge
= conditionGe.Parse(condition); = conditionGe.Parse(condition);

View File

@ -24,7 +24,7 @@
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmGeneratorExpression::cmGeneratorExpression( cmGeneratorExpression::cmGeneratorExpression(
cmListFileBacktrace const& backtrace): cmListFileBacktrace const* backtrace):
Backtrace(backtrace) Backtrace(backtrace)
{ {
} }
@ -34,9 +34,9 @@ cmsys::auto_ptr<cmCompiledGeneratorExpression>
cmGeneratorExpression::Parse(std::string const& input) cmGeneratorExpression::Parse(std::string const& input)
{ {
return cmsys::auto_ptr<cmCompiledGeneratorExpression>( return cmsys::auto_ptr<cmCompiledGeneratorExpression>(
new cmCompiledGeneratorExpression( new cmCompiledGeneratorExpression(
this->Backtrace, this->Backtrace ? *this->Backtrace : cmListFileBacktrace(),
input)); input));
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -41,7 +41,7 @@ class cmGeneratorExpression
{ {
public: public:
/** Construct. */ /** Construct. */
cmGeneratorExpression(cmListFileBacktrace const& backtrace); cmGeneratorExpression(cmListFileBacktrace const* backtrace = NULL);
~cmGeneratorExpression(); ~cmGeneratorExpression();
cmsys::auto_ptr<cmCompiledGeneratorExpression> Parse( cmsys::auto_ptr<cmCompiledGeneratorExpression> Parse(
@ -70,7 +70,7 @@ private:
cmGeneratorExpression(const cmGeneratorExpression &); cmGeneratorExpression(const cmGeneratorExpression &);
void operator=(const cmGeneratorExpression &); void operator=(const cmGeneratorExpression &);
cmListFileBacktrace const& Backtrace; cmListFileBacktrace const* Backtrace;
}; };
class cmCompiledGeneratorExpression class cmCompiledGeneratorExpression

View File

@ -23,6 +23,25 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
cmGeneratorExpressionDAGChecker *parent) cmGeneratorExpressionDAGChecker *parent)
: Parent(parent), Target(target), Property(property), : Parent(parent), Target(target), Property(property),
Content(content), Backtrace(backtrace), TransitivePropertiesOnly(false) Content(content), Backtrace(backtrace), TransitivePropertiesOnly(false)
{
Initialize();
}
//----------------------------------------------------------------------------
cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
const std::string &target,
const std::string &property,
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *parent)
: Parent(parent), Target(target), Property(property),
Content(content), TransitivePropertiesOnly(false)
{
Initialize();
}
//----------------------------------------------------------------------------
void
cmGeneratorExpressionDAGChecker::Initialize()
{ {
const cmGeneratorExpressionDAGChecker *top = this; const cmGeneratorExpressionDAGChecker *top = this;
const cmGeneratorExpressionDAGChecker *p = this->Parent; const cmGeneratorExpressionDAGChecker *p = this->Parent;
@ -43,11 +62,12 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
#undef TEST_TRANSITIVE_PROPERTY_METHOD #undef TEST_TRANSITIVE_PROPERTY_METHOD
{ {
std::map<std::string, std::set<std::string> >::const_iterator it std::map<std::string, std::set<std::string> >::const_iterator it
= top->Seen.find(target); = top->Seen.find(this->Target);
if (it != top->Seen.end()) if (it != top->Seen.end())
{ {
const std::set<std::string> &propSet = it->second; const std::set<std::string> &propSet = it->second;
const std::set<std::string>::const_iterator i = propSet.find(property); const std::set<std::string>::const_iterator i
= propSet.find(this->Property);
if (i != propSet.end()) if (i != propSet.end())
{ {
this->CheckResult = ALREADY_SEEN; this->CheckResult = ALREADY_SEEN;
@ -55,7 +75,7 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
} }
} }
const_cast<cmGeneratorExpressionDAGChecker *>(top) const_cast<cmGeneratorExpressionDAGChecker *>(top)
->Seen[target].insert(property); ->Seen[this->Target].insert(this->Property);
} }
} }

View File

@ -46,6 +46,10 @@ struct cmGeneratorExpressionDAGChecker
const std::string &property, const std::string &property,
const GeneratorExpressionContent *content, const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *parent); cmGeneratorExpressionDAGChecker *parent);
cmGeneratorExpressionDAGChecker(const std::string &target,
const std::string &property,
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *parent);
enum Result { enum Result {
DAG, DAG,
@ -76,6 +80,7 @@ struct cmGeneratorExpressionDAGChecker
private: private:
Result CheckGraph() const; Result CheckGraph() const;
void Initialize();
private: private:
const cmGeneratorExpressionDAGChecker * const Parent; const cmGeneratorExpressionDAGChecker * const Parent;

View File

@ -115,7 +115,7 @@ void cmGeneratorExpressionEvaluationFile::Generate()
} }
cmListFileBacktrace lfbt = this->OutputFileExpr->GetBacktrace(); cmListFileBacktrace lfbt = this->OutputFileExpr->GetBacktrace();
cmGeneratorExpression contentGE(lfbt); cmGeneratorExpression contentGE(&lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> inputExpression cmsys::auto_ptr<cmCompiledGeneratorExpression> inputExpression
= contentGE.Parse(inputContent); = contentGE.Parse(inputContent);

View File

@ -809,7 +809,7 @@ std::string getLinkedTargetsContent(const std::vector<cmTarget*> &targets,
cmGeneratorExpressionDAGChecker *dagChecker, cmGeneratorExpressionDAGChecker *dagChecker,
const std::string &interfacePropertyName) const std::string &interfacePropertyName)
{ {
cmGeneratorExpression ge(context->Backtrace); cmGeneratorExpression ge(&context->Backtrace);
std::string sep; std::string sep;
std::string depString; std::string depString;
@ -1196,7 +1196,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
{ {
if (targetPropertyTransitiveWhitelist[i] == interfacePropertyName) if (targetPropertyTransitiveWhitelist[i] == interfacePropertyName)
{ {
cmGeneratorExpression ge(context->Backtrace); cmGeneratorExpression ge(&context->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
std::string result = cge->Evaluate(context->Makefile, std::string result = cge->Evaluate(context->Makefile,
context->Config, context->Config,

View File

@ -259,12 +259,10 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
std::vector<std::string>& result, std::vector<std::string>& result,
bool excludeImported) bool excludeImported)
{ {
cmListFileBacktrace lfbt;
if (const char* dirs = if (const char* dirs =
depTgt->GetProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES")) depTgt->GetProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES"))
{ {
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge;
cmSystemTools::ExpandListArgument(ge.Parse(dirs) cmSystemTools::ExpandListArgument(ge.Parse(dirs)
->Evaluate(mf, ->Evaluate(mf,
config, false, headTarget, config, false, headTarget,
@ -278,7 +276,7 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
if (const char* dirs = if (const char* dirs =
depTgt->GetProperty("INTERFACE_INCLUDE_DIRECTORIES")) depTgt->GetProperty("INTERFACE_INCLUDE_DIRECTORIES"))
{ {
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge;
cmSystemTools::ExpandListArgument(ge.Parse(dirs) cmSystemTools::ExpandListArgument(ge.Parse(dirs)
->Evaluate(mf, ->Evaluate(mf,
config, false, headTarget, config, false, headTarget,
@ -457,8 +455,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
return false; return false;
} }
cmListFileBacktrace lfbt; cmGeneratorExpressionDAGChecker dagChecker(
cmGeneratorExpressionDAGChecker dagChecker(lfbt,
this->GetName(), this->GetName(),
"SYSTEM_INCLUDE_DIRECTORIES", 0, 0); "SYSTEM_INCLUDE_DIRECTORIES", 0, 0);
@ -470,7 +467,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
it = this->Target->GetSystemIncludeDirectories().begin(); it = this->Target->GetSystemIncludeDirectories().begin();
it != this->Target->GetSystemIncludeDirectories().end(); ++it) it != this->Target->GetSystemIncludeDirectories().end(); ++it)
{ {
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge;
cmSystemTools::ExpandListArgument(ge.Parse(*it) cmSystemTools::ExpandListArgument(ge.Parse(*it)
->Evaluate(this->Makefile, ->Evaluate(this->Makefile,
config, false, this->Target, config, false, this->Target,
@ -808,7 +805,7 @@ cmTargetTraceDependencies
{ {
// Transform command names that reference targets built in this // Transform command names that reference targets built in this
// project to corresponding target-level dependencies. // project to corresponding target-level dependencies.
cmGeneratorExpression ge(cc.GetBacktrace()); cmGeneratorExpression ge(&cc.GetBacktrace());
// Add target-level dependencies referenced by generator expressions. // Add target-level dependencies referenced by generator expressions.
std::set<cmTarget*> targets; std::set<cmTarget*> targets;

View File

@ -12,6 +12,7 @@
#include "cmInstallFilesGenerator.h" #include "cmInstallFilesGenerator.h"
#include "cmGeneratorExpression.h" #include "cmGeneratorExpression.h"
#include "cmMakefile.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -84,8 +85,7 @@ void cmInstallFilesGenerator::GenerateScriptForConfig(std::ostream& os,
Indent const& indent) Indent const& indent)
{ {
std::vector<std::string> files; std::vector<std::string> files;
cmListFileBacktrace lfbt; cmGeneratorExpression ge;
cmGeneratorExpression ge(lfbt);
for(std::vector<std::string>::const_iterator i = this->Files.begin(); for(std::vector<std::string>::const_iterator i = this->Files.begin();
i != this->Files.end(); ++i) i != this->Files.end(); ++i)
{ {

View File

@ -33,7 +33,7 @@ cmInstalledFile::~cmInstalledFile()
void cmInstalledFile::SetName(cmMakefile* mf, const std::string& name) void cmInstalledFile::SetName(cmMakefile* mf, const std::string& name)
{ {
cmListFileBacktrace backtrace = mf->GetBacktrace(); cmListFileBacktrace backtrace = mf->GetBacktrace();
cmGeneratorExpression ge(backtrace); cmGeneratorExpression ge(&backtrace);
this->Name = name; this->Name = name;
this->NameExpression = ge.Parse(name).release(); this->NameExpression = ge.Parse(name).release();
@ -70,7 +70,7 @@ void cmInstalledFile::AppendProperty(cmMakefile const* mf,
const std::string& prop, const char* value, bool /*asString*/) const std::string& prop, const char* value, bool /*asString*/)
{ {
cmListFileBacktrace backtrace = mf->GetBacktrace(); cmListFileBacktrace backtrace = mf->GetBacktrace();
cmGeneratorExpression ge(backtrace); cmGeneratorExpression ge(&backtrace);
Property& property = this->Properties[prop]; Property& property = this->Properties[prop];
property.ValueExpressions.push_back(ge.Parse(value).release()); property.ValueExpressions.push_back(ge.Parse(value).release());

View File

@ -137,8 +137,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
this->Makefile->GetProperty this->Makefile->GetProperty
("ADDITIONAL_MAKE_CLEAN_FILES")) ("ADDITIONAL_MAKE_CLEAN_FILES"))
{ {
cmListFileBacktrace lfbt; cmGeneratorExpression ge;
cmGeneratorExpression ge(lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(additional_clean_files); ge.Parse(additional_clean_files);

View File

@ -710,11 +710,8 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
this->DebugSourcesDone = true; this->DebugSourcesDone = true;
} }
cmListFileBacktrace lfbt; cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
"SOURCES", 0, 0);
cmGeneratorExpressionDAGChecker dagChecker(lfbt,
this->GetName(),
"SOURCES", 0, 0);
std::set<std::string> uniqueSrcs; std::set<std::string> uniqueSrcs;
bool contextDependentDirectSources = processSources(this, bool contextDependentDirectSources = processSources(this,
@ -739,7 +736,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
continue; continue;
} }
{ {
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(it->Value); ge.Parse(it->Value);
std::string targetResult = cge->Evaluate(this->Makefile, config, std::string targetResult = cge->Evaluate(this->Makefile, config,
@ -758,7 +755,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
// TARGET_PROPERTY expression. // TARGET_PROPERTY expression.
sourceGenex = "$<$<BOOL:" + it->Value + ">:" + sourceGenex + ">"; sourceGenex = "$<$<BOOL:" + it->Value + ">:" + sourceGenex + ">";
} }
cmGeneratorExpression ge(it->Backtrace); cmGeneratorExpression ge(&it->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse( cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
sourceGenex); sourceGenex);
@ -911,7 +908,7 @@ void cmTarget::AddTracedSources(std::vector<std::string> const& srcs)
this->Internal->SourceFilesMap.clear(); this->Internal->SourceFilesMap.clear();
this->LinkImplementationLanguageIsContextDependent = true; this->LinkImplementationLanguageIsContextDependent = true;
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge(&lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles);
cge->SetEvaluateForBuildsystem(true); cge->SetEvaluateForBuildsystem(true);
this->Internal->SourceEntries.push_back( this->Internal->SourceEntries.push_back(
@ -948,7 +945,7 @@ void cmTarget::AddSources(std::vector<std::string> const& srcs)
this->Internal->SourceFilesMap.clear(); this->Internal->SourceFilesMap.clear();
this->LinkImplementationLanguageIsContextDependent = true; this->LinkImplementationLanguageIsContextDependent = true;
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge(&lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles);
cge->SetEvaluateForBuildsystem(true); cge->SetEvaluateForBuildsystem(true);
this->Internal->SourceEntries.push_back( this->Internal->SourceEntries.push_back(
@ -1083,7 +1080,7 @@ cmSourceFile* cmTarget::AddSource(const std::string& src)
this->Internal->SourceFilesMap.clear(); this->Internal->SourceFilesMap.clear();
this->LinkImplementationLanguageIsContextDependent = true; this->LinkImplementationLanguageIsContextDependent = true;
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge(&lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src);
cge->SetEvaluateForBuildsystem(true); cge->SetEvaluateForBuildsystem(true);
this->Internal->SourceEntries.push_back( this->Internal->SourceEntries.push_back(
@ -1203,11 +1200,10 @@ void cmTarget::GetDirectLinkLibraries(const std::string& config,
const char *prop = this->GetProperty("LINK_LIBRARIES"); const char *prop = this->GetProperty("LINK_LIBRARIES");
if (prop) if (prop)
{ {
cmListFileBacktrace lfbt; cmGeneratorExpression ge;
cmGeneratorExpression ge(lfbt);
const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop); const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
cmGeneratorExpressionDAGChecker dagChecker(lfbt, cmGeneratorExpressionDAGChecker dagChecker(
this->GetName(), this->GetName(),
"LINK_LIBRARIES", 0, 0); "LINK_LIBRARIES", 0, 0);
cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile, cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile,
@ -1238,11 +1234,10 @@ void cmTarget::GetInterfaceLinkLibraries(const std::string& config,
const char *prop = this->GetProperty("INTERFACE_LINK_LIBRARIES"); const char *prop = this->GetProperty("INTERFACE_LINK_LIBRARIES");
if (prop) if (prop)
{ {
cmListFileBacktrace lfbt; cmGeneratorExpression ge;
cmGeneratorExpression ge(lfbt);
const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop); const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
cmGeneratorExpressionDAGChecker dagChecker(lfbt, cmGeneratorExpressionDAGChecker dagChecker(
this->GetName(), this->GetName(),
"INTERFACE_LINK_LIBRARIES", 0, 0); "INTERFACE_LINK_LIBRARIES", 0, 0);
cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile, cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile,
@ -1793,7 +1788,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
if(prop == "INCLUDE_DIRECTORIES") if(prop == "INCLUDE_DIRECTORIES")
{ {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge(&lfbt);
deleteAndClear(this->Internal->IncludeDirectoriesEntries); deleteAndClear(this->Internal->IncludeDirectoriesEntries);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
this->Internal->IncludeDirectoriesEntries.push_back( this->Internal->IncludeDirectoriesEntries.push_back(
@ -1803,7 +1798,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
if(prop == "COMPILE_OPTIONS") if(prop == "COMPILE_OPTIONS")
{ {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge(&lfbt);
deleteAndClear(this->Internal->CompileOptionsEntries); deleteAndClear(this->Internal->CompileOptionsEntries);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
this->Internal->CompileOptionsEntries.push_back( this->Internal->CompileOptionsEntries.push_back(
@ -1813,7 +1808,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
if(prop == "COMPILE_FEATURES") if(prop == "COMPILE_FEATURES")
{ {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge(&lfbt);
deleteAndClear(this->Internal->CompileFeaturesEntries); deleteAndClear(this->Internal->CompileFeaturesEntries);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
this->Internal->CompileFeaturesEntries.push_back( this->Internal->CompileFeaturesEntries.push_back(
@ -1823,7 +1818,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
if(prop == "COMPILE_DEFINITIONS") if(prop == "COMPILE_DEFINITIONS")
{ {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge(&lfbt);
deleteAndClear(this->Internal->CompileDefinitionsEntries); deleteAndClear(this->Internal->CompileDefinitionsEntries);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
this->Internal->CompileDefinitionsEntries.push_back( this->Internal->CompileDefinitionsEntries.push_back(
@ -1858,7 +1853,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
} }
this->Internal->SourceFilesMap.clear(); this->Internal->SourceFilesMap.clear();
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge(&lfbt);
this->Internal->SourceEntries.clear(); this->Internal->SourceEntries.clear();
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
this->Internal->SourceEntries.push_back( this->Internal->SourceEntries.push_back(
@ -1892,7 +1887,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
if(prop == "INCLUDE_DIRECTORIES") if(prop == "INCLUDE_DIRECTORIES")
{ {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge(&lfbt);
this->Internal->IncludeDirectoriesEntries.push_back( this->Internal->IncludeDirectoriesEntries.push_back(
new cmTargetInternals::TargetPropertyEntry(ge.Parse(value))); new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
return; return;
@ -1900,7 +1895,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
if(prop == "COMPILE_OPTIONS") if(prop == "COMPILE_OPTIONS")
{ {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge(&lfbt);
this->Internal->CompileOptionsEntries.push_back( this->Internal->CompileOptionsEntries.push_back(
new cmTargetInternals::TargetPropertyEntry(ge.Parse(value))); new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
return; return;
@ -1908,7 +1903,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
if(prop == "COMPILE_FEATURES") if(prop == "COMPILE_FEATURES")
{ {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge(&lfbt);
this->Internal->CompileFeaturesEntries.push_back( this->Internal->CompileFeaturesEntries.push_back(
new cmTargetInternals::TargetPropertyEntry(ge.Parse(value))); new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
return; return;
@ -1916,7 +1911,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
if(prop == "COMPILE_DEFINITIONS") if(prop == "COMPILE_DEFINITIONS")
{ {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge(&lfbt);
this->Internal->CompileDefinitionsEntries.push_back( this->Internal->CompileDefinitionsEntries.push_back(
new cmTargetInternals::TargetPropertyEntry(ge.Parse(value))); new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
return; return;
@ -1948,7 +1943,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
} }
this->Internal->SourceFilesMap.clear(); this->Internal->SourceFilesMap.clear();
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge(&lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
this->Internal->SourceEntries.push_back( this->Internal->SourceEntries.push_back(
new cmTargetInternals::TargetPropertyEntry(cge)); new cmTargetInternals::TargetPropertyEntry(cge));
@ -2014,7 +2009,7 @@ void cmTarget::AppendBuildInterfaceIncludes()
void cmTarget::InsertInclude(const cmValueWithOrigin &entry, void cmTarget::InsertInclude(const cmValueWithOrigin &entry,
bool before) bool before)
{ {
cmGeneratorExpression ge(entry.Backtrace); cmGeneratorExpression ge(&entry.Backtrace);
std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position
= before ? this->Internal->IncludeDirectoriesEntries.begin() = before ? this->Internal->IncludeDirectoriesEntries.begin()
@ -2028,7 +2023,7 @@ void cmTarget::InsertInclude(const cmValueWithOrigin &entry,
void cmTarget::InsertCompileOption(const cmValueWithOrigin &entry, void cmTarget::InsertCompileOption(const cmValueWithOrigin &entry,
bool before) bool before)
{ {
cmGeneratorExpression ge(entry.Backtrace); cmGeneratorExpression ge(&entry.Backtrace);
std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position
= before ? this->Internal->CompileOptionsEntries.begin() = before ? this->Internal->CompileOptionsEntries.begin()
@ -2041,7 +2036,7 @@ void cmTarget::InsertCompileOption(const cmValueWithOrigin &entry,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::InsertCompileDefinition(const cmValueWithOrigin &entry) void cmTarget::InsertCompileDefinition(const cmValueWithOrigin &entry)
{ {
cmGeneratorExpression ge(entry.Backtrace); cmGeneratorExpression ge(&entry.Backtrace);
this->Internal->CompileDefinitionsEntries.push_back( this->Internal->CompileDefinitionsEntries.push_back(
new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry.Value))); new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry.Value)));
@ -2082,14 +2077,13 @@ static void processIncludeDirectories(cmTarget const* tgt,
} }
} }
std::string usedIncludes; std::string usedIncludes;
cmListFileBacktrace lfbt;
for(std::vector<std::string>::iterator for(std::vector<std::string>::iterator
li = entryIncludes.begin(); li != entryIncludes.end(); ++li) li = entryIncludes.begin(); li != entryIncludes.end(); ++li)
{ {
std::string targetName = (*it)->TargetName; std::string targetName = (*it)->TargetName;
std::string evaluatedTargetName; std::string evaluatedTargetName;
{ {
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(targetName); ge.Parse(targetName);
evaluatedTargetName = cge->Evaluate(mf, config, false, tgt, 0, 0); evaluatedTargetName = cge->Evaluate(mf, config, false, tgt, 0, 0);
@ -2222,10 +2216,8 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
{ {
std::vector<std::string> includes; std::vector<std::string> includes;
std::set<std::string> uniqueIncludes; std::set<std::string> uniqueIncludes;
cmListFileBacktrace lfbt;
cmGeneratorExpressionDAGChecker dagChecker(lfbt, cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
this->GetName(),
"INCLUDE_DIRECTORIES", 0, 0); "INCLUDE_DIRECTORIES", 0, 0);
std::vector<std::string> debugProperties; std::vector<std::string> debugProperties;
@ -2268,7 +2260,7 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
continue; continue;
} }
{ {
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(it->Value); ge.Parse(it->Value);
std::string result = cge->Evaluate(this->Makefile, config, std::string result = cge->Evaluate(this->Makefile, config,
@ -2287,7 +2279,7 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
// TARGET_PROPERTY expression. // TARGET_PROPERTY expression.
includeGenex = "$<$<BOOL:" + it->Value + ">:" + includeGenex + ">"; includeGenex = "$<$<BOOL:" + it->Value + ">:" + includeGenex + ">";
} }
cmGeneratorExpression ge(it->Backtrace); cmGeneratorExpression ge(&it->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse( cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
includeGenex); includeGenex);
@ -2316,7 +2308,7 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
libDir = frameworkCheck.match(1); libDir = frameworkCheck.match(1);
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(libDir.c_str()); ge.Parse(libDir.c_str());
this->Internal this->Internal
@ -2430,10 +2422,9 @@ void cmTarget::GetAutoUicOptions(std::vector<std::string> &result,
{ {
return; return;
} }
cmListFileBacktrace lfbt; cmGeneratorExpression ge;
cmGeneratorExpression ge(lfbt);
cmGeneratorExpressionDAGChecker dagChecker(lfbt, cmGeneratorExpressionDAGChecker dagChecker(
this->GetName(), this->GetName(),
"AUTOUIC_OPTIONS", 0, 0); "AUTOUIC_OPTIONS", 0, 0);
cmSystemTools::ExpandListArgument(ge.Parse(prop) cmSystemTools::ExpandListArgument(ge.Parse(prop)
@ -2450,11 +2441,9 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
const std::string& config) const const std::string& config) const
{ {
std::set<std::string> uniqueOptions; std::set<std::string> uniqueOptions;
cmListFileBacktrace lfbt;
cmGeneratorExpressionDAGChecker dagChecker(lfbt, cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
this->GetName(), "COMPILE_OPTIONS", 0, 0);
"COMPILE_OPTIONS", 0, 0);
std::vector<std::string> debugProperties; std::vector<std::string> debugProperties;
const char *debugProp = const char *debugProp =
@ -2496,7 +2485,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
continue; continue;
} }
{ {
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(it->Value); ge.Parse(it->Value);
std::string targetResult = cge->Evaluate(this->Makefile, config, std::string targetResult = cge->Evaluate(this->Makefile, config,
@ -2515,7 +2504,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
// TARGET_PROPERTY expression. // TARGET_PROPERTY expression.
optionGenex = "$<$<BOOL:" + it->Value + ">:" + optionGenex + ">"; optionGenex = "$<$<BOOL:" + it->Value + ">:" + optionGenex + ">";
} }
cmGeneratorExpression ge(it->Backtrace); cmGeneratorExpression ge(&it->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse( cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
optionGenex); optionGenex);
@ -2562,11 +2551,9 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
const std::string& config) const const std::string& config) const
{ {
std::set<std::string> uniqueOptions; std::set<std::string> uniqueOptions;
cmListFileBacktrace lfbt;
cmGeneratorExpressionDAGChecker dagChecker(lfbt, cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
this->GetName(), "COMPILE_DEFINITIONS", 0, 0);
"COMPILE_DEFINITIONS", 0, 0);
std::vector<std::string> debugProperties; std::vector<std::string> debugProperties;
const char *debugProp = const char *debugProp =
@ -2608,7 +2595,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
continue; continue;
} }
{ {
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(it->Value); ge.Parse(it->Value);
std::string targetResult = cge->Evaluate(this->Makefile, config, std::string targetResult = cge->Evaluate(this->Makefile, config,
@ -2627,7 +2614,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
// TARGET_PROPERTY expression. // TARGET_PROPERTY expression.
defsGenex = "$<$<BOOL:" + it->Value + ">:" + defsGenex + ">"; defsGenex = "$<$<BOOL:" + it->Value + ">:" + defsGenex + ">";
} }
cmGeneratorExpression ge(it->Backtrace); cmGeneratorExpression ge(&it->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse( cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
defsGenex); defsGenex);
@ -2655,7 +2642,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
} }
case cmPolicies::OLD: case cmPolicies::OLD:
{ {
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(configProp); ge.Parse(configProp);
this->Internal this->Internal
@ -2710,10 +2697,8 @@ void cmTarget::GetCompileFeatures(std::vector<std::string> &result,
const std::string& config) const const std::string& config) const
{ {
std::set<std::string> uniqueFeatures; std::set<std::string> uniqueFeatures;
cmListFileBacktrace lfbt;
cmGeneratorExpressionDAGChecker dagChecker(lfbt, cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
this->GetName(),
"COMPILE_FEATURES", "COMPILE_FEATURES",
0, 0); 0, 0);
@ -2757,7 +2742,7 @@ void cmTarget::GetCompileFeatures(std::vector<std::string> &result,
continue; continue;
} }
{ {
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(it->Value); ge.Parse(it->Value);
std::string targetResult = cge->Evaluate(this->Makefile, config, std::string targetResult = cge->Evaluate(this->Makefile, config,
@ -2776,7 +2761,7 @@ void cmTarget::GetCompileFeatures(std::vector<std::string> &result,
// TARGET_PROPERTY expression. // TARGET_PROPERTY expression.
featureGenex = "$<$<BOOL:" + it->Value + ">:" + featureGenex + ">"; featureGenex = "$<$<BOOL:" + it->Value + ">:" + featureGenex + ">";
} }
cmGeneratorExpression ge(it->Backtrace); cmGeneratorExpression ge(&it->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse( cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
featureGenex); featureGenex);
@ -5904,10 +5889,9 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
} }
if(propertyLibs) if(propertyLibs)
{ {
cmListFileBacktrace lfbt; cmGeneratorExpression ge;
cmGeneratorExpression ge(lfbt);
cmGeneratorExpressionDAGChecker dagChecker(lfbt, cmGeneratorExpressionDAGChecker dagChecker(
this->GetName(), this->GetName(),
linkProp, 0, 0); linkProp, 0, 0);
cmSystemTools::ExpandListArgument(ge.Parse(propertyLibs) cmSystemTools::ExpandListArgument(ge.Parse(propertyLibs)
@ -6227,10 +6211,9 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config,
} }
// The interface libraries have been explicitly set. // The interface libraries have been explicitly set.
cmListFileBacktrace lfbt; cmGeneratorExpression ge;
cmGeneratorExpression ge(lfbt); cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(), linkIfaceProp, 0, 0);
linkIfaceProp, 0, 0);
dagChecker.SetTransitivePropertiesOnly(); dagChecker.SetTransitivePropertiesOnly();
std::vector<std::string> libs; std::vector<std::string> libs;
cmSystemTools::ExpandListArgument(ge.Parse(interfaceLibs)->Evaluate( cmSystemTools::ExpandListArgument(ge.Parse(interfaceLibs)->Evaluate(
@ -6339,9 +6322,8 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
if(explicitLibraries) if(explicitLibraries)
{ {
// The interface libraries have been explicitly set. // The interface libraries have been explicitly set.
cmListFileBacktrace lfbt; cmGeneratorExpression ge;
cmGeneratorExpression ge(lfbt); cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
linkIfaceProp, 0, 0); linkIfaceProp, 0, 0);
cmSystemTools::ExpandListArgument(ge.Parse(explicitLibraries)->Evaluate( cmSystemTools::ExpandListArgument(ge.Parse(explicitLibraries)->Evaluate(
this->Makefile, this->Makefile,
@ -6366,9 +6348,8 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
{ {
// Compare the link implementation fallback link interface to the // Compare the link implementation fallback link interface to the
// preferred new link interface property and warn if different. // preferred new link interface property and warn if different.
cmListFileBacktrace lfbt; cmGeneratorExpression ge;
cmGeneratorExpression ge(lfbt); cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
"INTERFACE_LINK_LIBRARIES", 0, 0); "INTERFACE_LINK_LIBRARIES", 0, 0);
std::vector<std::string> ifaceLibs; std::vector<std::string> ifaceLibs;
const char* newExplicitLibraries = const char* newExplicitLibraries =

View File

@ -21,20 +21,18 @@ cmTest::cmTest(cmMakefile* mf)
this->Makefile = mf; this->Makefile = mf;
this->OldStyle = true; this->OldStyle = true;
this->Properties.SetCMakeInstance(mf->GetCMakeInstance()); this->Properties.SetCMakeInstance(mf->GetCMakeInstance());
this->Backtrace = new cmListFileBacktrace; this->Backtrace = this->Makefile->GetBacktrace();
*this->Backtrace = this->Makefile->GetBacktrace();
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTest::~cmTest() cmTest::~cmTest()
{ {
delete this->Backtrace;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmListFileBacktrace const& cmTest::GetBacktrace() const cmListFileBacktrace const& cmTest::GetBacktrace() const
{ {
return *this->Backtrace; return this->Backtrace;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -14,8 +14,8 @@
#include "cmCustomCommand.h" #include "cmCustomCommand.h"
#include "cmPropertyMap.h" #include "cmPropertyMap.h"
#include "cmListFileCache.h"
class cmMakefile; class cmMakefile;
class cmListFileBacktrace;
/** \class cmTest /** \class cmTest
* \brief Represent a test * \brief Represent a test
@ -71,7 +71,7 @@ private:
bool OldStyle; bool OldStyle;
cmMakefile* Makefile; cmMakefile* Makefile;
cmListFileBacktrace* Backtrace; cmListFileBacktrace Backtrace;
}; };
#endif #endif

View File

@ -70,7 +70,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
this->TestGenerated = true; this->TestGenerated = true;
// Set up generator expression evaluation context. // Set up generator expression evaluation context.
cmGeneratorExpression ge(this->Test->GetBacktrace()); cmGeneratorExpression ge(&this->Test->GetBacktrace());
// Start the test command. // Start the test command.
os << indent << "add_test(" << this->Test->GetName() << " "; os << indent << "add_test(" << this->Test->GetName() << " ";