浏览代码

cmGlobalGenerator: Extract new IsExcluded overload.

Stephen Kelly 10 年之前
父节点
当前提交
be56feb618
共有 2 个文件被更改,包括 16 次插入6 次删除
  1. 14 6
      Source/cmGlobalGenerator.cxx
  2. 2 0
      Source/cmGlobalGenerator.h

+ 14 - 6
Source/cmGlobalGenerator.cxx

@@ -2041,13 +2041,10 @@ void cmGlobalGenerator::SetConfiguredFilesPath(cmGlobalGenerator* gen)
     }
 }
 
-bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
-                                   cmLocalGenerator* gen) const
+bool cmGlobalGenerator::IsExcluded(cmState::Snapshot const& rootSnp,
+                       cmState::Snapshot const& snp_) const
 {
-  assert(gen);
-
-  cmState::Snapshot rootSnp = root->GetStateSnapshot();
-  cmState::Snapshot snp = gen->GetStateSnapshot();
+  cmState::Snapshot snp = snp_;
   while (snp.IsValid())
     {
     if(snp == rootSnp)
@@ -2066,6 +2063,17 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
   return false;
 }
 
+bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
+                                   cmLocalGenerator* gen) const
+{
+  assert(gen);
+
+  cmState::Snapshot rootSnp = root->GetStateSnapshot();
+  cmState::Snapshot snp = gen->GetStateSnapshot();
+
+  return this->IsExcluded(rootSnp, snp);
+}
+
 bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
                                    cmGeneratorTarget* target) const
 {

+ 2 - 0
Source/cmGlobalGenerator.h

@@ -396,6 +396,8 @@ protected:
   // has been populated.
   void FillProjectMap();
   void CheckLocalGenerators();
+  bool IsExcluded(cmState::Snapshot const& root,
+                  cmState::Snapshot const& snp) const;
   bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen) const;
   bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) const;
   virtual void InitializeProgressMarks() {}