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