[Cmake-commits] CMake branch, next, updated. v2.8.11.1-2575-gef0bfdb
Stephen Kelly
steveire at gmail.com
Mon Jun 10 10:53:52 EDT 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 ef0bfdb43ded98e7a2dbb9fa35e2f1a7a257123a (commit)
via 0d8db250ceedf908a32c96c0a7e532f3fe9e61d9 (commit)
from c533fec3f75289d82f70d7f77a1ef3141baa755f (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=ef0bfdb43ded98e7a2dbb9fa35e2f1a7a257123a
commit ef0bfdb43ded98e7a2dbb9fa35e2f1a7a257123a
Merge: c533fec 0d8db25
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jun 10 10:53:51 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jun 10 10:53:51 2013 -0400
Merge topic 'transitive-property-PP-FOR_EACH' into next
0d8db25 Use a preprocessor loop to manage the valid transitive properties.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0d8db250ceedf908a32c96c0a7e532f3fe9e61d9
commit 0d8db250ceedf908a32c96c0a7e532f3fe9e61d9
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jun 10 16:01:59 2013 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jun 10 16:13:21 2013 +0200
Use a preprocessor loop to manage the valid transitive properties.
Hopefully this will prevent regressions when adding further transitive
properties in the future.
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index 29406dc..e7b185a 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -31,9 +31,10 @@ bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
ImportPropertyMap properties;
- this->FindTargets("INTERFACE_INCLUDE_DIRECTORIES", te, emittedDeps);
- this->FindTargets("INTERFACE_COMPILE_DEFINITIONS", te, emittedDeps);
- this->FindTargets("INTERFACE_COMPILE_OPTIONS", te, emittedDeps);
+#define FIND_TARGETS(PROPERTY) \
+ this->FindTargets(#PROPERTY, te, emittedDeps);
+
+ CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(FIND_TARGETS)
this->PopulateProperties(te, properties, emittedDeps);
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 6c6a7d4..3e03c09 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -33,9 +33,13 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
}
this->CheckResult = this->checkGraph();
- if (CheckResult == DAG && (top->EvaluatingIncludeDirectories()
- || top->EvaluatingCompileDefinitions()
- || top->EvaluatingCompileOptions()))
+#define TEST_TRANSITIVE_PROPERTY_METHOD(METHOD) \
+ top->METHOD () ||
+
+ if (CheckResult == DAG && (
+ CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(TEST_TRANSITIVE_PROPERTY_METHOD)
+ false)
+ )
{
std::map<cmStdString, std::set<cmStdString> >::const_iterator it
= top->Seen.find(target);
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 8d9fd76..85b13e5 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -16,6 +16,16 @@
#include "cmGeneratorExpressionEvaluator.h"
+#define CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(F) \
+ F(EvaluatingIncludeDirectories) \
+ F(EvaluatingCompileDefinitions) \
+ F(EvaluatingCompileOptions)
+
+#define CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(F) \
+ F(INTERFACE_INCLUDE_DIRECTORIES) \
+ F(INTERFACE_COMPILE_DEFINITIONS) \
+ F(INTERFACE_COMPILE_OPTIONS)
+
//----------------------------------------------------------------------------
struct cmGeneratorExpressionDAGChecker
{
@@ -38,9 +48,11 @@ struct cmGeneratorExpressionDAGChecker
const std::string &expr);
bool EvaluatingLinkLibraries();
- bool EvaluatingIncludeDirectories() const;
- bool EvaluatingCompileDefinitions() const;
- bool EvaluatingCompileOptions() const;
+
+#define DECLARE_TRANSITIVE_PROPERTY_METHOD(METHOD) \
+ bool METHOD () const;
+
+CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(DECLARE_TRANSITIVE_PROPERTY_METHOD)
private:
Result checkGraph() const;
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 28f749d..676fd29 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -491,11 +491,13 @@ static const struct JoinNode : public cmGeneratorExpressionNode
}
} joinNode;
+#define TRANSITIVE_PROPERTY_NAME(PROPERTY) \
+ , #PROPERTY
+
//----------------------------------------------------------------------------
static const char* targetPropertyTransitiveWhitelist[] = {
- "INTERFACE_INCLUDE_DIRECTORIES"
- , "INTERFACE_COMPILE_DEFINITIONS"
- , "INTERFACE_COMPILE_OPTIONS"
+ 0
+ CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(TRANSITIVE_PROPERTY_NAME)
};
std::string getLinkedTargetsContent(const std::vector<std::string> &libraries,
@@ -675,7 +677,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
// No error. We just skip cyclic references.
return std::string();
case cmGeneratorExpressionDAGChecker::ALREADY_SEEN:
- for (size_t i = 0;
+ for (size_t i = 1;
i < (sizeof(targetPropertyTransitiveWhitelist) /
sizeof(*targetPropertyTransitiveWhitelist));
++i)
@@ -703,9 +705,13 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
else
{
- assert(dagCheckerParent->EvaluatingIncludeDirectories()
- || dagCheckerParent->EvaluatingCompileDefinitions()
- || dagCheckerParent->EvaluatingCompileOptions());
+#define ASSERT_TRANSITIVE_PROPERTY_METHOD(METHOD) \
+ dagCheckerParent->METHOD () ||
+
+ assert(
+ CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(
+ ASSERT_TRANSITIVE_PROPERTY_METHOD)
+ false);
}
}
@@ -732,7 +738,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
cmTarget *headTarget = context->HeadTarget ? context->HeadTarget : target;
- const char **transBegin = targetPropertyTransitiveWhitelist;
+ const char **transBegin = targetPropertyTransitiveWhitelist + 1;
const char **transEnd = targetPropertyTransitiveWhitelist
+ (sizeof(targetPropertyTransitiveWhitelist) /
sizeof(*targetPropertyTransitiveWhitelist));
@@ -798,7 +804,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
return linkedTargetsContent;
}
- for (size_t i = 0;
+ for (size_t i = 1;
i < (sizeof(targetPropertyTransitiveWhitelist) /
sizeof(*targetPropertyTransitiveWhitelist));
++i)
-----------------------------------------------------------------------
Summary of changes:
Source/cmExportTryCompileFileGenerator.cxx | 7 ++++---
Source/cmGeneratorExpressionDAGChecker.cxx | 10 +++++++---
Source/cmGeneratorExpressionDAGChecker.h | 18 +++++++++++++++---
Source/cmGeneratorExpressionEvaluator.cxx | 24 +++++++++++++++---------
4 files changed, 41 insertions(+), 18 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list