diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-06-10 14:01:59 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-06-10 14:13:21 (GMT) |
commit | 0d8db250ceedf908a32c96c0a7e532f3fe9e61d9 (patch) | |
tree | 6fca18a5bcd3a77c1fd08e94e07e47bf4e0aa693 /Source/cmGeneratorExpressionEvaluator.cxx | |
parent | 8a3b5bede8c8fc16b7b7b25d7e665e8936de04ee (diff) | |
download | CMake-0d8db250ceedf908a32c96c0a7e532f3fe9e61d9.zip CMake-0d8db250ceedf908a32c96c0a7e532f3fe9e61d9.tar.gz CMake-0d8db250ceedf908a32c96c0a7e532f3fe9e61d9.tar.bz2 |
Use a preprocessor loop to manage the valid transitive properties.
Hopefully this will prevent regressions when adding further transitive
properties in the future.
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluator.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 24 |
1 files changed, 15 insertions, 9 deletions
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) |