mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-13 01:29:02 -05:00
cmGlobalGenerator: Refactor IsExcluded.
Make it easier to convert it to a loop.
This commit is contained in:
@@ -2044,7 +2044,9 @@ void cmGlobalGenerator::SetConfiguredFilesPath(cmGlobalGenerator* gen)
|
|||||||
bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
|
bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
|
||||||
cmLocalGenerator* gen) const
|
cmLocalGenerator* gen) const
|
||||||
{
|
{
|
||||||
if(!gen || gen == root)
|
assert(gen);
|
||||||
|
|
||||||
|
if(gen == root)
|
||||||
{
|
{
|
||||||
// No directory excludes itself.
|
// No directory excludes itself.
|
||||||
return false;
|
return false;
|
||||||
@@ -2056,9 +2058,15 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmLocalGenerator* lg = gen->GetParent();
|
||||||
|
if (!lg)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// This directory is included in its parent. Check whether the
|
// This directory is included in its parent. Check whether the
|
||||||
// parent is excluded.
|
// parent is excluded.
|
||||||
return this->IsExcluded(root, gen->GetParent());
|
return this->IsExcluded(root, lg);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
|
bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
|
||||||
|
|||||||
Reference in New Issue
Block a user