summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-08-02 07:51:56 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-08-24 18:03:29 (GMT)
commit5f05b56284f9a76aa90562186aebd383a3ca9349 (patch)
tree82549221637ddc064566c6c7e9444dee8c4d7e88
parent95925a60fce8a7b60fbea9873d9bb9fadf47cd02 (diff)
downloadCMake-5f05b56284f9a76aa90562186aebd383a3ca9349.zip
CMake-5f05b56284f9a76aa90562186aebd383a3ca9349.tar.gz
CMake-5f05b56284f9a76aa90562186aebd383a3ca9349.tar.bz2
cmGlobalGenerator: Refactor IsExcluded.
Make it easier to convert it to a loop.
-rw-r--r--Source/cmGlobalGenerator.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 71b00c4..a610b3d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2044,7 +2044,9 @@ void cmGlobalGenerator::SetConfiguredFilesPath(cmGlobalGenerator* gen)
bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
cmLocalGenerator* gen) const
{
- if(!gen || gen == root)
+ assert(gen);
+
+ if(gen == root)
{
// No directory excludes itself.
return false;
@@ -2056,9 +2058,15 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
return true;
}
+ cmLocalGenerator* lg = gen->GetParent();
+ if (!lg)
+ {
+ return false;
+ }
+
// This directory is included in its parent. Check whether the
// parent is excluded.
- return this->IsExcluded(root, gen->GetParent());
+ return this->IsExcluded(root, lg);
}
bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,