diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-02-09 10:12:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-02-22 13:35:29 (GMT) |
commit | f2ab17d4db86af5695f70b5c49f388319e510472 (patch) | |
tree | b8da6f951e3df6f34cd1292e9ae87f5947fe92f0 | |
parent | 0ad58af4445e8c3ccf1ac987698b7ec50e25020c (diff) | |
download | CMake-f2ab17d4db86af5695f70b5c49f388319e510472.zip CMake-f2ab17d4db86af5695f70b5c49f388319e510472.tar.gz CMake-f2ab17d4db86af5695f70b5c49f388319e510472.tar.bz2 |
Keep track of all targets seen while evaluating a genex.
As dependencies of the generator expression, these will re-exported
in try_compile generated code.
-rw-r--r-- | Source/cmGeneratorExpression.cxx | 3 | ||||
-rw-r--r-- | Source/cmGeneratorExpression.h | 8 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.h | 3 |
4 files changed, 13 insertions, 5 deletions
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 5d162fe..51ebddb 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -114,7 +114,8 @@ const char *cmCompiledGeneratorExpression::Evaluate( this->HadContextSensitiveCondition = context.HadContextSensitiveCondition; } - this->Targets = context.Targets; + this->DependTargets = context.DependTargets; + this->AllTargetsSeen = context.AllTargets; // TODO: Return a std::string from here instead? return this->Output.c_str(); } diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 489b052..e223034 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -88,11 +88,14 @@ public: /** Get set of targets found during evaluations. */ std::set<cmTarget*> const& GetTargets() const - { return this->Targets; } + { return this->DependTargets; } std::set<cmStdString> const& GetSeenTargetProperties() const { return this->SeenTargetProperties; } + std::set<cmTarget*> const& GetAllTargetsSeen() const + { return this->AllTargetsSeen; } + ~cmCompiledGeneratorExpression(); std::string GetInput() const @@ -123,7 +126,8 @@ private: const std::string Input; bool NeedsParsing; - mutable std::set<cmTarget*> Targets; + mutable std::set<cmTarget*> DependTargets; + mutable std::set<cmTarget*> AllTargetsSeen; mutable std::set<cmStdString> SeenTargetProperties; mutable std::string Output; mutable bool HadContextSensitiveCondition; diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index cd6a40b..97ba524 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -392,6 +392,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode reportError(context, content->GetOriginalExpression(), e.str()); return std::string(); } + context->AllTargets.insert(target); } if (target == context->HeadTarget) @@ -852,7 +853,8 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode "Target \"" + name + "\" is not an executable or library."); return std::string(); } - context->Targets.insert(target); + context->DependTargets.insert(target); + context->AllTargets.insert(target); std::string result = TargetFilesystemArtifactResultCreator<linker, soname>::Create( diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h index 37d5c86..ce7ad69 100644 --- a/Source/cmGeneratorExpressionEvaluator.h +++ b/Source/cmGeneratorExpressionEvaluator.h @@ -23,7 +23,8 @@ class cmTarget; struct cmGeneratorExpressionContext { cmListFileBacktrace Backtrace; - std::set<cmTarget*> Targets; + std::set<cmTarget*> DependTargets; + std::set<cmTarget*> AllTargets; std::set<cmStdString> SeenTargetProperties; cmMakefile *Makefile; const char *Config; |