[Cmake-commits] CMake branch, next, updated. v2.8.10.2-1866-gb9d91c1
Stephen Kelly
steveire at gmail.com
Sat Feb 2 07:17:32 EST 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via b9d91c163c82cb1035804ac26046d3476a9707d6 (commit)
via a9ac9eb5f6bc113cf70d7ef55dc61153183c3afa (commit)
from cf153061aafc919b81cfa75ea92d7a0807014779 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b9d91c163c82cb1035804ac26046d3476a9707d6
commit b9d91c163c82cb1035804ac26046d3476a9707d6
Merge: cf15306 a9ac9eb
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Feb 2 07:17:30 2013 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Feb 2 07:17:30 2013 -0500
Merge topic 'tll-includes-defines' into next
a9ac9eb Optimize genex evaluation for includes and defines.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a9ac9eb5f6bc113cf70d7ef55dc61153183c3afa
commit a9ac9eb5f6bc113cf70d7ef55dc61153183c3afa
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Feb 1 09:38:40 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Feb 2 13:11:41 2013 +0100
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.
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index bcb0820..aa61783 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -24,7 +24,32 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
: Parent(parent), Target(target), Property(property),
Content(content), Backtrace(backtrace)
{
+ const cmGeneratorExpressionDAGChecker *top = this;
+ const cmGeneratorExpressionDAGChecker *p = this->Parent;
+ while (p)
+ {
+ top = p;
+ p = p->Parent;
+ }
this->CheckResult = this->checkGraph();
+
+ if (CheckResult == DAG && (top->Property == "INCLUDE_DIRECTORIES"
+ || top->Property == "COMPILE_DEFINITIONS") )
+ {
+ std::map<cmStdString, std::set<cmStdString> >::const_iterator it
+ = top->Seen.find(target);
+ if (it != top->Seen.end()
+ && it->second.find(property) != it->second.end())
+ {
+ this->CheckResult = ALREADY_SEEN;
+ return;
+ }
+ else
+ {
+ const_cast<cmGeneratorExpressionDAGChecker *>(top)
+ ->Seen[target].insert(property);
+ }
+ }
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 7e9c62a..a2e5ce4 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -28,7 +28,8 @@ struct cmGeneratorExpressionDAGChecker
enum Result {
DAG,
SELF_REFERENCE,
- CYCLIC_REFERENCE
+ CYCLIC_REFERENCE,
+ ALREADY_SEEN
};
Result check() const;
@@ -47,6 +48,7 @@ private:
const cmGeneratorExpressionDAGChecker * const Parent;
const std::string Target;
const std::string Property;
+ std::map<cmStdString, std::set<cmStdString> > Seen;
const GeneratorExpressionContent * const Content;
const cmListFileBacktrace Backtrace;
Result CheckResult;
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;
}
-----------------------------------------------------------------------
Summary of changes:
Source/cmGeneratorExpressionDAGChecker.cxx | 25 +++++++++++++++++++++++++
Source/cmGeneratorExpressionDAGChecker.h | 4 +++-
Source/cmGeneratorExpressionEvaluator.cxx | 6 ++++++
3 files changed, 34 insertions(+), 1 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list