Browse Source

cmGlobalGenerator: Convert IsExcluded to loop.

Stephen Kelly 10 years ago
parent
commit
9b44018d52
1 changed files with 14 additions and 18 deletions
  1. 14 18
      Source/cmGlobalGenerator.cxx

+ 14 - 18
Source/cmGlobalGenerator.cxx

@@ -2046,27 +2046,23 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
 {
   assert(gen);
 
-  if(gen == root)
+  cmLocalGenerator* lg = gen;
+  while (lg)
     {
-    // No directory excludes itself.
-    return false;
-    }
-
-  if(gen->GetMakefile()->GetPropertyAsBool("EXCLUDE_FROM_ALL"))
-    {
-    // This directory is excluded from its parent.
-    return true;
-    }
+    if(lg == root)
+      {
+      // No directory excludes itself.
+      return false;
+      }
 
-  cmLocalGenerator* lg = gen->GetParent();
-  if (!lg)
-    {
-    return false;
+    if(lg->GetMakefile()->GetPropertyAsBool("EXCLUDE_FROM_ALL"))
+      {
+      // This directory is excluded from its parent.
+      return true;
+      }
+    lg = lg->GetParent();
     }
-
-  // This directory is included in its parent.  Check whether the
-  // parent is excluded.
-  return this->IsExcluded(root, lg);
+  return false;
 }
 
 bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,