summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-08-04 19:30:17 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-08-07 15:06:19 (GMT)
commit197f4de110a59332757360110b1e90f6b07e1c97 (patch)
treef5dd32e1cd3d2b25a672d325f94fe40239ccabaa /Source/cmTarget.cxx
parent44e071aeff4d533f116a7721919f9036c5d5a1d1 (diff)
downloadCMake-197f4de110a59332757360110b1e90f6b07e1c97.zip
CMake-197f4de110a59332757360110b1e90f6b07e1c97.tar.gz
CMake-197f4de110a59332757360110b1e90f6b07e1c97.tar.bz2
cmTarget: Split storage of compile definitions from genexes.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx51
1 files changed, 19 insertions, 32 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index cc1df84..1277fc2 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -177,7 +177,9 @@ public:
std::vector<std::string> CompileFeaturesEntries;
std::vector<cmListFileBacktrace> CompileFeaturesBacktraces;
std::vector<TargetPropertyEntry*> CompileFeaturesItems;
- std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
+ std::vector<std::string> CompileDefinitionsEntries;
+ std::vector<cmListFileBacktrace> CompileDefinitionsBacktraces;
+ std::vector<TargetPropertyEntry*> CompileDefinitionsItems;
std::vector<TargetPropertyEntry*> SourceEntries;
std::vector<cmValueWithOrigin> LinkImplementationPropertyEntries;
@@ -474,6 +476,11 @@ void cmTarget::Compute()
this->Internal->CompileFeaturesEntries,
this->Internal->CompileFeaturesBacktraces,
this->Internal->CompileFeaturesItems);
+
+ CreatePropertyGeneratorExpressions(
+ this->Internal->CompileDefinitionsEntries,
+ this->Internal->CompileDefinitionsBacktraces,
+ this->Internal->CompileDefinitionsItems);
}
//----------------------------------------------------------------------------
@@ -1728,12 +1735,11 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
}
else if(prop == "COMPILE_DEFINITIONS")
{
+ this->Internal->CompileDefinitionsEntries.clear();
+ this->Internal->CompileDefinitionsBacktraces.clear();
+ this->Internal->CompileDefinitionsEntries.push_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- cmGeneratorExpression ge(lfbt);
- deleteAndClear(this->Internal->CompileDefinitionsEntries);
- cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
- this->Internal->CompileDefinitionsEntries.push_back(
- new cmTargetInternals::TargetPropertyEntry(cge));
+ this->Internal->CompileDefinitionsBacktraces.push_back(lfbt);
}
else if(prop == "EXPORT_NAME" && this->IsImported())
{
@@ -1817,10 +1823,9 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
else if(prop == "COMPILE_DEFINITIONS")
{
+ this->Internal->CompileDefinitionsEntries.push_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- cmGeneratorExpression ge(lfbt);
- this->Internal->CompileDefinitionsEntries.push_back(
- new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
+ this->Internal->CompileDefinitionsBacktraces.push_back(lfbt);
}
else if(prop == "EXPORT_NAME" && this->IsImported())
{
@@ -1952,10 +1957,8 @@ void cmTarget::InsertCompileOption(std::string const& entry,
void cmTarget::InsertCompileDefinition(std::string const& entry,
cmListFileBacktrace const& bt)
{
- cmGeneratorExpression ge(bt);
-
- this->Internal->CompileDefinitionsEntries.push_back(
- new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry)));
+ this->Internal->CompileDefinitionsEntries.push_back(entry);
+ this->Internal->CompileDefinitionsBacktraces.push_back(bt);
}
//----------------------------------------------------------------------------
@@ -2337,7 +2340,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
}
processCompileDefinitions(this,
- this->Internal->CompileDefinitionsEntries,
+ this->Internal->CompileDefinitionsItems,
list,
uniqueOptions,
&dagChecker,
@@ -2745,22 +2748,6 @@ bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const
}
//----------------------------------------------------------------------------
-static void MakePropertyList(std::string& output,
- std::vector<cmTargetInternals::TargetPropertyEntry*> const& values)
-{
- output = "";
- std::string sep;
- for (std::vector<cmTargetInternals::TargetPropertyEntry*>::const_iterator
- it = values.begin(), end = values.end();
- it != end; ++it)
- {
- output += sep;
- output += (*it)->ge->GetInput();
- sep = ";";
- }
-}
-
-//----------------------------------------------------------------------------
const char *cmTarget::GetProperty(const std::string& prop) const
{
return this->GetProperty(prop, this->Makefile);
@@ -2968,7 +2955,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
}
static std::string output;
- MakePropertyList(output, this->Internal->CompileDefinitionsEntries);
+ output = cmJoin(this->Internal->CompileDefinitionsEntries, ";");
return output.c_str();
}
else if (prop == propIMPORTED)
@@ -4844,7 +4831,7 @@ cmTargetInternalPointer::~cmTargetInternalPointer()
cmDeleteAll(this->Pointer->IncludeDirectoriesItems);
cmDeleteAll(this->Pointer->CompileOptionsItems);
cmDeleteAll(this->Pointer->CompileFeaturesItems);
- cmDeleteAll(this->Pointer->CompileDefinitionsEntries);
+ cmDeleteAll(this->Pointer->CompileDefinitionsItems);
cmDeleteAll(this->Pointer->SourceEntries);
delete this->Pointer;
}