diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-02-01 08:38:40 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-02-02 14:06:53 (GMT) |
commit | 089fe1c13d8fa73be5182162a855c17351d1f918 (patch) | |
tree | 288b2e9576fff37aee787df74075dfe9ebbe6155 /Source/cmGeneratorExpressionEvaluator.cxx | |
parent | 179f49560286e2e322b9b0cf5d0a277b7634540f (diff) | |
download | CMake-089fe1c13d8fa73be5182162a855c17351d1f918.zip CMake-089fe1c13d8fa73be5182162a855c17351d1f918.tar.gz CMake-089fe1c13d8fa73be5182162a855c17351d1f918.tar.bz2 |
Optimize genex evaluation for includes and defines.
While porting boost to use these features, the generation step took
too long (several minutes before I stopped it). The reason was that
the boost libraries form a large interdependent mesh. The libraries
list their dependencies in their INTERFACE such as:
$<LINKED:boost::core>;$<LINKED:boost::config>;$<LINKED:boost::mpl>
As boost::core already depends on the boost::config libraries, that
expression has no impact on the end-content, as it is removed after
the generation step. There is no DAG issue though, so the generator
expression evaluation would fully evaluate them. In the case of the
config library, it also depends on the core library, so all depends
are followed through that again, despite the fact that they've just
been evaluated. After this patch, the evaluation skips libraries if
they have already been seen via depends or directly in the content.
This patch keeps track of targets whose INTERFACE has been consumed
already. The INCLUDE_DIRECTORIES and COMPILE_DEFINITIONS properties
are whitelisted because repeated content will be stripped out later
during generation. For other properties now and in the future, that
may not be the case.
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluator.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index cbea1d9..cd4b7d8 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -435,6 +435,9 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode case cmGeneratorExpressionDAGChecker::CYCLIC_REFERENCE: // No error. We just skip cyclic references. return std::string(); + case cmGeneratorExpressionDAGChecker::ALREADY_SEEN: + // No error. We're not going to find anything new here. + return std::string(); case cmGeneratorExpressionDAGChecker::DAG: break; } @@ -705,6 +708,9 @@ private: case cmGeneratorExpressionDAGChecker::CYCLIC_REFERENCE: // No error. We just skip cyclic references. return std::string(); + case cmGeneratorExpressionDAGChecker::ALREADY_SEEN: + // No error. We're not going to find anything new here. + return std::string(); case cmGeneratorExpressionDAGChecker::DAG: break; } |