summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-10-21 23:12:24 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-10-22 08:45:23 (GMT)
commit86d5d808c812357e13085f39439453d225a5b9e2 (patch)
tree2c1895c8b992ad90b0628cc454b123b2b0ab27fe /Source
parent73d7705416a29ab75789cfe5d37ab5720b00d98d (diff)
downloadCMake-86d5d808c812357e13085f39439453d225a5b9e2.zip
CMake-86d5d808c812357e13085f39439453d225a5b9e2.tar.gz
CMake-86d5d808c812357e13085f39439453d225a5b9e2.tar.bz2
Genex: Remove use of TransitiveWhitelistCompare
Replace with generic solution based on cmArray* for better readability.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx30
1 files changed, 9 insertions, 21 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 7fd0fdc..bc873e0 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -704,17 +704,6 @@ std::string getLinkedTargetsContent(const std::vector<std::string> &libraries,
}
//----------------------------------------------------------------------------
-struct TransitiveWhitelistCompare
-{
- explicit TransitiveWhitelistCompare(const std::string &needle)
- : Needle(needle) {}
- bool operator() (const char *item)
- { return strcmp(item, this->Needle.c_str()) == 0; }
-private:
- std::string Needle;
-};
-
-//----------------------------------------------------------------------------
static const struct TargetPropertyNode : public cmGeneratorExpressionNode
{
TargetPropertyNode() {}
@@ -864,8 +853,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
return std::string();
case cmGeneratorExpressionDAGChecker::ALREADY_SEEN:
for (size_t i = 1;
- i < (sizeof(targetPropertyTransitiveWhitelist) /
- sizeof(*targetPropertyTransitiveWhitelist));
+ i < cmArraySize(targetPropertyTransitiveWhitelist);
++i)
{
if (targetPropertyTransitiveWhitelist[i] == propertyName)
@@ -928,12 +916,13 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
cmTarget *headTarget = context->HeadTarget ? context->HeadTarget : target;
- const char **transBegin = targetPropertyTransitiveWhitelist + 1;
- const char **transEnd = targetPropertyTransitiveWhitelist
- + (sizeof(targetPropertyTransitiveWhitelist) /
- sizeof(*targetPropertyTransitiveWhitelist));
+ const char * const *transBegin =
+ cmArrayBegin(targetPropertyTransitiveWhitelist) + 1;
+ const char * const *transEnd =
+ cmArrayEnd(targetPropertyTransitiveWhitelist);
+
if (std::find_if(transBegin, transEnd,
- TransitiveWhitelistCompare(propertyName)) != transEnd)
+ cmStrCmp(propertyName)) != transEnd)
{
std::vector<std::string> libs;
@@ -949,7 +938,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
}
else if (std::find_if(transBegin, transEnd,
- TransitiveWhitelistCompare(interfacePropertyName)) != transEnd)
+ cmStrCmp(interfacePropertyName)) != transEnd)
{
const cmTarget::LinkImplementation *impl = target->GetLinkImplementation(
context->Config,
@@ -996,8 +985,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
for (size_t i = 1;
- i < (sizeof(targetPropertyTransitiveWhitelist) /
- sizeof(*targetPropertyTransitiveWhitelist));
+ i < cmArraySize(targetPropertyTransitiveWhitelist);
++i)
{
if (targetPropertyTransitiveWhitelist[i] == interfacePropertyName)