From 45f52003962f2f5ae58be2dd779f441bb4ca01f7 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 09:57:25 +0200 Subject: cmGlobalGenerator: Implement IsExcluded in terms of cmState::Snapshot. --- Source/cmGlobalGenerator.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index b7b4fba..d7aca47 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2046,21 +2046,22 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root, { assert(gen); - cmLocalGenerator* lg = gen; - while (lg) + cmState::Snapshot rootSnp = root->GetStateSnapshot(); + cmState::Snapshot snp = gen->GetStateSnapshot(); + while (snp.IsValid()) { - if(lg == root) + if(snp == rootSnp) { // No directory excludes itself. return false; } - if(lg->GetMakefile()->GetPropertyAsBool("EXCLUDE_FROM_ALL")) + if(snp.GetDirectory().GetPropertyAsBool("EXCLUDE_FROM_ALL")) { // This directory is excluded from its parent. return true; } - lg = lg->GetParent(); + snp = snp.GetBuildsystemDirectoryParent(); } return false; } -- cgit v0.12