summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionEvaluator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-06-24 12:46:46 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-06-24 12:46:46 (GMT)
commit0fd7d471385f043dbff298d925914f4e6a9fcfbf (patch)
tree540ab2494c905d14052248733c89b6fedb295677 /Source/cmGeneratorExpressionEvaluator.cxx
parent6d7b124f7b925099115dee6cf1b4194e3f946786 (diff)
parent0d8db250ceedf908a32c96c0a7e532f3fe9e61d9 (diff)
downloadCMake-0fd7d471385f043dbff298d925914f4e6a9fcfbf.zip
CMake-0fd7d471385f043dbff298d925914f4e6a9fcfbf.tar.gz
CMake-0fd7d471385f043dbff298d925914f4e6a9fcfbf.tar.bz2
Merge topic 'transitive-property-PP-FOR_EACH'
0d8db25 Use a preprocessor loop to manage the valid transitive properties.
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluator.cxx')
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx24
1 files changed, 15 insertions, 9 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 04ade4a..701c547 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -488,11 +488,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,
@@ -672,7 +674,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)
@@ -700,9 +702,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);
}
}
@@ -729,7 +735,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));
@@ -795,7 +801,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)