summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-09-12 13:11:25 (GMT)
committerBrad King <brad.king@kitware.com>2012-09-18 21:03:08 (GMT)
commit91011bd217726f73e362b10d77a6638977d6a781 (patch)
tree5feed05d259d3c4b8b152e51a1d567a0e26a508a /Source/cmTarget.cxx
parentf1eacf0e07759b57d100dbf5d83c70e4028bcb54 (diff)
downloadCMake-91011bd217726f73e362b10d77a6638977d6a781.zip
CMake-91011bd217726f73e362b10d77a6638977d6a781.tar.gz
CMake-91011bd217726f73e362b10d77a6638977d6a781.tar.bz2
cmGeneratorExpression: Port users to two-stage processing
Removing the Process() API and removing the parameters from the constructor will allow cmGeneratorExpressions to be cached and evaluated with multiple configs for example, such as when evaluating target properties. This requires the creation of a new compiled representation of cmGeneratorExpression. The cmListFileBacktrace remains in the constructor so that we can record where a particular generator expression appeared in the CMakeLists file.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 789713f..9a3812c 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1623,7 +1623,11 @@ cmTargetTraceDependencies
{
// Transform command names that reference targets built in this
// project to corresponding target-level dependencies.
- cmGeneratorExpression ge(this->Makefile, 0, cc.GetBacktrace(), true);
+ cmGeneratorExpression ge(cc.GetBacktrace());
+
+ // Add target-level dependencies referenced by generator expressions.
+ std::set<cmTarget*> targets;
+
for(cmCustomCommandLines::const_iterator cit = cc.GetCommandLines().begin();
cit != cc.GetCommandLines().end(); ++cit)
{
@@ -1645,12 +1649,17 @@ cmTargetTraceDependencies
for(cmCustomCommandLine::const_iterator cli = cit->begin();
cli != cit->end(); ++cli)
{
- ge.Process(*cli);
+ const cmCompiledGeneratorExpression &cge = ge.Parse(*cli);
+ cge.Evaluate(this->Makefile, 0, true);
+ std::set<cmTarget*> geTargets = cge.GetTargets();
+ for(std::set<cmTarget*>::const_iterator it = geTargets.begin();
+ it != geTargets.end(); ++it)
+ {
+ targets.insert(*it);
+ }
}
}
- // Add target-level dependencies referenced by generator expressions.
- std::set<cmTarget*> targets = ge.GetTargets();
for(std::set<cmTarget*>::iterator ti = targets.begin();
ti != targets.end(); ++ti)
{