[Cmake-commits] CMake branch, next, updated. v3.3.0-rc3-767-gfe3cbb7

Stephen Kelly steveire at gmail.com
Tue Jun 30 17:35:42 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  fe3cbb78721dc84d01ab030422a67013d1595f3d (commit)
       via  48c6a92b286522cf350412d6dd3219b263e9ab5b (commit)
       via  e28e110d221a50687cc9922743366b2f34ccd852 (commit)
       via  3f5200ec5f17de36d0db1729d61e520fb014abe5 (commit)
       via  0a34ea597a954f49335559108bf3fa3382734657 (commit)
       via  be5997ef77dccc866ddb96bdfd2f529f74988eef (commit)
       via  5bf9bfda3f364b27ca91eacab18ec4dad2cc59f7 (commit)
       via  f346d88d102c627e98f630ae1c9d26cc899f76d8 (commit)
       via  b661403177edb1d22b89cc4a0ea69a8f93ad2ad2 (commit)
       via  6708d21664baf3bab6f8af143c373de7af84bffc (commit)
       via  0818737c851dce18a6da442ee73029b0de22ad56 (commit)
       via  dd7e42758d4874c087bbbc6ae062f36455f6d49c (commit)
       via  92cecd936999f9a4c67332d1aeaba3ff120fbbc2 (commit)
       via  276c62253e3f25eda4acbf0049a70c7d622c9ea2 (commit)
      from  d2e9ccbc7f3de688d3ec187ab093607eab8d82d7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe3cbb78721dc84d01ab030422a67013d1595f3d
commit fe3cbb78721dc84d01ab030422a67013d1595f3d
Merge: d2e9ccb 48c6a92
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jun 30 17:35:41 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jun 30 17:35:41 2015 -0400

    Merge topic 'clean-up-cmMakefile' into next
    
    48c6a92b cmMakefile: Merge two Scope types and instances.
    e28e110d cmMakefile: Rename a variable.
    3f5200ec cmMakefile: Expand the scope of scoped buildsystem file state.
    0a34ea59 cmMakefile: Compute the filename processed in a scope.
    be5997ef cmMakefile: Inline ProcessBuildsystemFile into only caller.
    5bf9bfda cmMakefile: Don't use string comparison to check directory level.
    f346d88d cmMakefile: Avoid invoking EnforceDirectoryLevelRules.
    b6614031 cmMakefile: Add filename to ReadListFile auto scopes.
    6708d216 cmMakefile: Remove IncludeScope Quiet call.
    0818737c cmMakefile: Make listfile scopes responsible for logical checks.
    dd7e4275 cmMakefile: Move the lexical scope.
    92cecd93 cmMakefile: Add automatic scopes to listfile readers.
    276c6225 cmMakefile: Move the IncludeScope to where it is used.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=48c6a92b286522cf350412d6dd3219b263e9ab5b
commit 48c6a92b286522cf350412d6dd3219b263e9ab5b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jun 26 00:13:22 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jun 30 23:14:22 2015 +0200

    cmMakefile: Merge two Scope types and instances.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0edced5..cdcf88c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1626,35 +1626,6 @@ bool cmMakefile::IsRootMakefile() const
   return !this->StateSnapshot.GetBuildsystemDirectoryParent().IsValid();
 }
 
-//----------------------------------------------------------------------------
-class cmMakefileCurrent
-{
-  cmGlobalGenerator* GG;
-  cmMakefile* CurrentMakefile;
-  cmState::Snapshot Snapshot;
-public:
-  cmMakefileCurrent(cmMakefile* mf)
-    {
-    this->GG = mf->GetGlobalGenerator();
-    this->CurrentMakefile = this->GG->GetCurrentMakefile();
-    this->Snapshot = this->GG->GetCMakeInstance()->GetCurrentSnapshot();
-    this->GG->GetCMakeInstance()->SetCurrentSnapshot(
-          this->GG->GetCMakeInstance()->GetCurrentSnapshot());
-    this->GG->SetCurrentMakefile(mf);
-#if defined(CMAKE_BUILD_WITH_CMAKE)
-    this->GG->GetFileLockPool().PushFileScope();
-#endif
-    }
-  ~cmMakefileCurrent()
-    {
-#if defined(CMAKE_BUILD_WITH_CMAKE)
-    this->GG->GetFileLockPool().PopFileScope();
-#endif
-    this->GG->SetCurrentMakefile(this->CurrentMakefile);
-    this->GG->GetCMakeInstance()->SetCurrentSnapshot(this->Snapshot);
-    }
-};
-
 class cmMakefile::BuildsystemFileScope
 {
 public:
@@ -1667,24 +1638,41 @@ public:
     this->Makefile->ListFileStack.push_back(currentStart);
     this->Makefile->PushPolicyBarrier();
     this->Makefile->PushFunctionBlockerBarrier();
+
+    this->GG = mf->GetGlobalGenerator();
+    this->CurrentMakefile = this->GG->GetCurrentMakefile();
+    this->Snapshot = this->GG->GetCMakeInstance()->GetCurrentSnapshot();
+    this->GG->GetCMakeInstance()->SetCurrentSnapshot(
+          this->GG->GetCMakeInstance()->GetCurrentSnapshot());
+    this->GG->SetCurrentMakefile(mf);
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+    this->GG->GetFileLockPool().PushFileScope();
+#endif
   }
 
   ~BuildsystemFileScope()
   {
     this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
     this->Makefile->PopPolicyBarrier(this->ReportError);
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+    this->GG->GetFileLockPool().PopFileScope();
+#endif
+    this->GG->SetCurrentMakefile(this->CurrentMakefile);
+    this->GG->GetCMakeInstance()->SetCurrentSnapshot(this->Snapshot);
   }
 
   void Quiet() { this->ReportError = false; }
 private:
   cmMakefile* Makefile;
+  cmGlobalGenerator* GG;
+  cmMakefile* CurrentMakefile;
+  cmState::Snapshot Snapshot;
   bool ReportError;
 };
 
 //----------------------------------------------------------------------------
 void cmMakefile::Configure()
 {
-  cmMakefileCurrent cmf(this);
   BuildsystemFileScope scope(this);
 
   // make sure the CMakeFiles dir is there

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e28e110d221a50687cc9922743366b2f34ccd852
commit e28e110d221a50687cc9922743366b2f34ccd852
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jun 26 00:11:51 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jun 30 23:14:22 2015 +0200

    cmMakefile: Rename a variable.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 79f4c44..0edced5 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1630,13 +1630,13 @@ bool cmMakefile::IsRootMakefile() const
 class cmMakefileCurrent
 {
   cmGlobalGenerator* GG;
-  cmMakefile* MF;
+  cmMakefile* CurrentMakefile;
   cmState::Snapshot Snapshot;
 public:
   cmMakefileCurrent(cmMakefile* mf)
     {
     this->GG = mf->GetGlobalGenerator();
-    this->MF = this->GG->GetCurrentMakefile();
+    this->CurrentMakefile = this->GG->GetCurrentMakefile();
     this->Snapshot = this->GG->GetCMakeInstance()->GetCurrentSnapshot();
     this->GG->GetCMakeInstance()->SetCurrentSnapshot(
           this->GG->GetCMakeInstance()->GetCurrentSnapshot());
@@ -1650,7 +1650,7 @@ public:
 #if defined(CMAKE_BUILD_WITH_CMAKE)
     this->GG->GetFileLockPool().PopFileScope();
 #endif
-    this->GG->SetCurrentMakefile(this->MF);
+    this->GG->SetCurrentMakefile(this->CurrentMakefile);
     this->GG->GetCMakeInstance()->SetCurrentSnapshot(this->Snapshot);
     }
 };

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f5200ec5f17de36d0db1729d61e520fb014abe5
commit 3f5200ec5f17de36d0db1729d61e520fb014abe5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jun 26 00:11:10 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jun 30 23:14:21 2015 +0200

    cmMakefile: Expand the scope of scoped buildsystem file state.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 3aaf8d0..79f4c44 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1685,6 +1685,7 @@ private:
 void cmMakefile::Configure()
 {
   cmMakefileCurrent cmf(this);
+  BuildsystemFileScope scope(this);
 
   // make sure the CMakeFiles dir is there
   std::string filesDir = this->StateSnapshot.GetCurrentBinaryDirectory();
@@ -1696,8 +1697,6 @@ void cmMakefile::Configure()
   assert(cmSystemTools::FileExists(currentStart.c_str(), true));
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentStart.c_str());
 
-  {
-  BuildsystemFileScope scope(this);
   cmListFile listFile;
   if (!listFile.ParseFile(currentStart.c_str(), this->IsRootMakefile(), this))
     {
@@ -1709,7 +1708,6 @@ void cmMakefile::Configure()
     {
     scope.Quiet();
     }
-  }
 
    // at the end handle any old style subdirs
   std::vector<cmMakefile*> subdirs = this->UnConfiguredDirectories;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a34ea597a954f49335559108bf3fa3382734657
commit 0a34ea597a954f49335559108bf3fa3382734657
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jun 21 23:19:50 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jun 30 23:14:21 2015 +0200

    cmMakefile: Compute the filename processed in a scope.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 32dd8f5..3aaf8d0 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1658,10 +1658,13 @@ public:
 class cmMakefile::BuildsystemFileScope
 {
 public:
-  BuildsystemFileScope(cmMakefile* mf, std::string const& filename)
+  BuildsystemFileScope(cmMakefile* mf)
     : Makefile(mf), ReportError(true)
   {
-    this->Makefile->ListFileStack.push_back(filename);
+    std::string currentStart =
+        this->Makefile->StateSnapshot.GetCurrentSourceDirectory();
+    currentStart += "/CMakeLists.txt";
+    this->Makefile->ListFileStack.push_back(currentStart);
     this->Makefile->PushPolicyBarrier();
     this->Makefile->PushFunctionBlockerBarrier();
   }
@@ -1694,7 +1697,7 @@ void cmMakefile::Configure()
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentStart.c_str());
 
   {
-  BuildsystemFileScope scope(this, currentStart);
+  BuildsystemFileScope scope(this);
   cmListFile listFile;
   if (!listFile.ParseFile(currentStart.c_str(), this->IsRootMakefile(), this))
     {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=be5997ef77dccc866ddb96bdfd2f529f74988eef
commit be5997ef77dccc866ddb96bdfd2f529f74988eef
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jun 21 23:13:24 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jun 30 23:14:21 2015 +0200

    cmMakefile: Inline ProcessBuildsystemFile into only caller.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 53c2d4c..32dd8f5 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -405,48 +405,6 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
   return result;
 }
 
-class cmMakefile::BuildsystemFileScope
-{
-public:
-  BuildsystemFileScope(cmMakefile* mf, std::string const& filename)
-    : Makefile(mf), ReportError(true)
-  {
-    this->Makefile->ListFileStack.push_back(filename);
-    this->Makefile->PushPolicyBarrier();
-    this->Makefile->PushFunctionBlockerBarrier();
-  }
-
-  ~BuildsystemFileScope()
-  {
-    this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
-    this->Makefile->PopPolicyBarrier(this->ReportError);
-  }
-
-  void Quiet() { this->ReportError = false; }
-private:
-  cmMakefile* Makefile;
-  bool ReportError;
-};
-
-bool cmMakefile::ProcessBuildsystemFile(const char* filename)
-{
-  this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename);
-
-  BuildsystemFileScope scope(this, filename);
-
-  cmListFile listFile;
-  if (!listFile.ParseFile(filename, this->IsRootMakefile(), this))
-    {
-    return false;
-    }
-  this->ReadListFile(listFile, filename);
-  if(cmSystemTools::GetFatalErrorOccured())
-    {
-    scope.Quiet();
-    }
-  return true;
-}
-
 //----------------------------------------------------------------------------
 class cmMakefile::IncludeScope
 {
@@ -1697,6 +1655,29 @@ public:
     }
 };
 
+class cmMakefile::BuildsystemFileScope
+{
+public:
+  BuildsystemFileScope(cmMakefile* mf, std::string const& filename)
+    : Makefile(mf), ReportError(true)
+  {
+    this->Makefile->ListFileStack.push_back(filename);
+    this->Makefile->PushPolicyBarrier();
+    this->Makefile->PushFunctionBlockerBarrier();
+  }
+
+  ~BuildsystemFileScope()
+  {
+    this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
+    this->Makefile->PopPolicyBarrier(this->ReportError);
+  }
+
+  void Quiet() { this->ReportError = false; }
+private:
+  cmMakefile* Makefile;
+  bool ReportError;
+};
+
 //----------------------------------------------------------------------------
 void cmMakefile::Configure()
 {
@@ -1710,7 +1691,22 @@ void cmMakefile::Configure()
   std::string currentStart = this->StateSnapshot.GetCurrentSourceDirectory();
   currentStart += "/CMakeLists.txt";
   assert(cmSystemTools::FileExists(currentStart.c_str(), true));
-  this->ProcessBuildsystemFile(currentStart.c_str());
+  this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentStart.c_str());
+
+  {
+  BuildsystemFileScope scope(this, currentStart);
+  cmListFile listFile;
+  if (!listFile.ParseFile(currentStart.c_str(), this->IsRootMakefile(), this))
+    {
+    this->SetConfigured();
+    return;
+    }
+  this->ReadListFile(listFile, currentStart);
+  if(cmSystemTools::GetFatalErrorOccured())
+    {
+    scope.Quiet();
+    }
+  }
 
    // at the end handle any old style subdirs
   std::vector<cmMakefile*> subdirs = this->UnConfiguredDirectories;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5bf9bfda3f364b27ca91eacab18ec4dad2cc59f7
commit 5bf9bfda3f364b27ca91eacab18ec4dad2cc59f7
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jun 21 23:01:13 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jun 30 23:14:20 2015 +0200

    cmMakefile: Don't use string comparison to check directory level.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 87292ea..53c2d4c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -431,12 +431,11 @@ private:
 bool cmMakefile::ProcessBuildsystemFile(const char* filename)
 {
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename);
-  std::string curSrc = this->GetCurrentSourceDirectory();
 
   BuildsystemFileScope scope(this, filename);
 
   cmListFile listFile;
-  if (!listFile.ParseFile(filename, curSrc == this->GetHomeDirectory(), this))
+  if (!listFile.ParseFile(filename, this->IsRootMakefile(), this))
     {
     return false;
     }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f346d88d102c627e98f630ae1c9d26cc899f76d8
commit f346d88d102c627e98f630ae1c9d26cc899f76d8
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jun 21 23:00:44 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jun 30 23:14:20 2015 +0200

    cmMakefile: Avoid invoking EnforceDirectoryLevelRules.
    
    This is part of the CMP0000 implementation and only needs to be invoked
    for top-level buildsystem files currently.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 23ab93d..383984d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1106,6 +1106,7 @@ void cmGlobalGenerator::Configure()
 
   // now do it
   lg->GetMakefile()->Configure();
+  lg->GetMakefile()->EnforceDirectoryLevelRules();
 
   // update the cache entry for the number of local generators, this is used
   // for progress
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index b9a66d3..87292ea 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -445,7 +445,6 @@ bool cmMakefile::ProcessBuildsystemFile(const char* filename)
     {
     scope.Quiet();
     }
-  this->EnforceDirectoryLevelRules();
   return true;
 }
 
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index ebf33df..aa70c72 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -825,6 +825,8 @@ public:
 
   std::string GetExecutionFilePath() const;
 
+  void EnforceDirectoryLevelRules() const;
+
 protected:
   // add link libraries and directories to the target
   void AddGlobalLinkInformation(const std::string& name, cmTarget& target);
@@ -975,9 +977,6 @@ private:
   cmPolicies::PolicyStatus
   GetPolicyStatusInternal(cmPolicies::PolicyID id) const;
 
-  // Enforce rules about CMakeLists.txt files.
-  void EnforceDirectoryLevelRules() const;
-
   // CMP0053 == old
   cmake::MessageType ExpandVariablesInStringOld(
                                   std::string& errorstr,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b661403177edb1d22b89cc4a0ea69a8f93ad2ad2
commit b661403177edb1d22b89cc4a0ea69a8f93ad2ad2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jun 21 22:56:15 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jun 30 23:14:19 2015 +0200

    cmMakefile: Add filename to ReadListFile auto scopes.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index b21e441..b9a66d3 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -408,9 +408,10 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
 class cmMakefile::BuildsystemFileScope
 {
 public:
-  BuildsystemFileScope(cmMakefile* mf)
+  BuildsystemFileScope(cmMakefile* mf, std::string const& filename)
     : Makefile(mf), ReportError(true)
   {
+    this->Makefile->ListFileStack.push_back(filename);
     this->Makefile->PushPolicyBarrier();
     this->Makefile->PushFunctionBlockerBarrier();
   }
@@ -432,14 +433,13 @@ bool cmMakefile::ProcessBuildsystemFile(const char* filename)
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename);
   std::string curSrc = this->GetCurrentSourceDirectory();
 
-  this->ListFileStack.push_back(filename);
+  BuildsystemFileScope scope(this, filename);
 
   cmListFile listFile;
   if (!listFile.ParseFile(filename, curSrc == this->GetHomeDirectory(), this))
     {
     return false;
     }
-  BuildsystemFileScope scope(this);
   this->ReadListFile(listFile, filename);
   if(cmSystemTools::GetFatalErrorOccured())
     {
@@ -604,9 +604,10 @@ bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
 class cmMakefile::ListFileScope
 {
 public:
-  ListFileScope(cmMakefile* mf)
+  ListFileScope(cmMakefile* mf, std::string const& filenametoread)
     : Makefile(mf), ReportError(true)
   {
+    this->Makefile->ListFileStack.push_back(filenametoread);
     this->Makefile->PushPolicyBarrier();
     this->Makefile->PushFunctionBlockerBarrier();
   }
@@ -630,7 +631,7 @@ bool cmMakefile::ReadListFile(const char* filename)
     cmSystemTools::CollapseFullPath(filename,
                                     this->GetCurrentSourceDirectory());
 
-  this->ListFileStack.push_back(filenametoread);
+  ListFileScope scope(this, filenametoread);
 
   cmListFile listFile;
   if (!listFile.ParseFile(filenametoread.c_str(), false, this))
@@ -638,7 +639,6 @@ bool cmMakefile::ReadListFile(const char* filename)
     return false;
     }
 
-  ListFileScope scope(this);
   this->ReadListFile(listFile, filenametoread);
   if(cmSystemTools::GetFatalErrorOccured())
     {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6708d21664baf3bab6f8af143c373de7af84bffc
commit 6708d21664baf3bab6f8af143c373de7af84bffc
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jun 23 09:25:03 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jun 30 23:14:19 2015 +0200

    cmMakefile: Remove IncludeScope Quiet call.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d6cf104..b21e441 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -591,7 +591,6 @@ bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
   cmListFile listFile;
   if (!listFile.ParseFile(filenametoread.c_str(), false, this))
     {
-    incScope.Quiet();
     return false;
     }
   this->ReadListFile(listFile, filenametoread);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0818737c851dce18a6da442ee73029b0de22ad56
commit 0818737c851dce18a6da442ee73029b0de22ad56
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jun 21 22:53:16 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jun 30 23:14:18 2015 +0200

    cmMakefile: Make listfile scopes responsible for logical checks.
    
    Remove the LexicalPushPop.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9948ac8..d6cf104 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -412,10 +412,12 @@ public:
     : Makefile(mf), ReportError(true)
   {
     this->Makefile->PushPolicyBarrier();
+    this->Makefile->PushFunctionBlockerBarrier();
   }
 
   ~BuildsystemFileScope()
   {
+    this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
     this->Makefile->PopPolicyBarrier(this->ReportError);
   }
 
@@ -502,11 +504,13 @@ cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
   // The included file cannot pop our policy scope.
   this->Makefile->PushPolicyBarrier();
   this->Makefile->ListFileStack.push_back(filenametoread);
+  this->Makefile->PushFunctionBlockerBarrier();
 }
 
 //----------------------------------------------------------------------------
 cmMakefile::IncludeScope::~IncludeScope()
 {
+  this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
   // Enforce matching policy scopes inside the included file.
   this->Makefile->PopPolicyBarrier(this->ReportError);
 
@@ -605,10 +609,12 @@ public:
     : Makefile(mf), ReportError(true)
   {
     this->Makefile->PushPolicyBarrier();
+    this->Makefile->PushFunctionBlockerBarrier();
   }
 
   ~ListFileScope()
   {
+    this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
     this->Makefile->PopPolicyBarrier(this->ReportError);
     this->Makefile->ListFileStack.pop_back();
   }
@@ -645,8 +651,6 @@ bool cmMakefile::ReadListFile(const char* filename)
 void cmMakefile::ReadListFile(cmListFile const& listFile,
                               std::string const& filenametoread)
 {
-  LexicalPushPop lexScope(this);
-
   // add this list file to the list of dependencies
   this->ListFiles.push_back(filenametoread);
 
@@ -671,8 +675,6 @@ void cmMakefile::ReadListFile(cmListFile const& listFile,
     this->ExecuteCommand(listFile.Functions[i],status);
     if(cmSystemTools::GetFatalErrorOccured())
       {
-      // Exit early due to error.
-      lexScope.Quiet();
       break;
       }
     if(status.GetReturnInvoked())
@@ -3521,19 +3523,6 @@ cmMakefile::RemoveFunctionBlocker(cmFunctionBlocker* fb,
   return cmsys::auto_ptr<cmFunctionBlocker>();
 }
 
-//----------------------------------------------------------------------------
-cmMakefile::LexicalPushPop::LexicalPushPop(cmMakefile* mf):
-  Makefile(mf), ReportError(true)
-{
-  this->Makefile->PushFunctionBlockerBarrier();
-}
-
-//----------------------------------------------------------------------------
-cmMakefile::LexicalPushPop::~LexicalPushPop()
-{
-  this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
-}
-
 const char* cmMakefile::GetHomeDirectory() const
 {
   return this->GetCMakeInstance()->GetHomeDirectory();
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 64783e5..ebf33df 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -100,19 +100,6 @@ public:
   cmsys::auto_ptr<cmFunctionBlocker>
   RemoveFunctionBlocker(cmFunctionBlocker* fb, const cmListFileFunction& lff);
 
-  /** Push/pop a lexical (function blocker) barrier automatically.  */
-  class LexicalPushPop
-  {
-  public:
-    LexicalPushPop(cmMakefile* mf);
-    ~LexicalPushPop();
-    void Quiet() { this->ReportError = false; }
-  private:
-    cmMakefile* Makefile;
-    bool ReportError;
-  };
-  friend class LexicalPushPop;
-
   /**
    * Try running cmake and building a file. This is used for dynalically
    * loaded commands, not as part of the usual build process.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd7e42758d4874c087bbbc6ae062f36455f6d49c
commit dd7e42758d4874c087bbbc6ae062f36455f6d49c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jun 21 22:50:52 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jun 30 23:14:18 2015 +0200

    cmMakefile: Move the lexical scope.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index a10f99c..9948ac8 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -645,6 +645,8 @@ bool cmMakefile::ReadListFile(const char* filename)
 void cmMakefile::ReadListFile(cmListFile const& listFile,
                               std::string const& filenametoread)
 {
+  LexicalPushPop lexScope(this);
+
   // add this list file to the list of dependencies
   this->ListFiles.push_back(filenametoread);
 
@@ -661,9 +663,6 @@ void cmMakefile::ReadListFile(cmListFile const& listFile,
   this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
   this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
 
-  // Enforce balanced blocks (if/endif, function/endfunction, etc.).
-  LexicalPushPop lexScope(this);
-
   // Run the parsed commands.
   const size_t numberFunctions = listFile.Functions.size();
   for(size_t i =0; i < numberFunctions; ++i)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=92cecd936999f9a4c67332d1aeaba3ff120fbbc2
commit 92cecd936999f9a4c67332d1aeaba3ff120fbbc2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jun 21 22:50:13 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jun 30 23:14:18 2015 +0200

    cmMakefile: Add automatic scopes to listfile readers.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 5225605..a10f99c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -405,6 +405,26 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
   return result;
 }
 
+class cmMakefile::BuildsystemFileScope
+{
+public:
+  BuildsystemFileScope(cmMakefile* mf)
+    : Makefile(mf), ReportError(true)
+  {
+    this->Makefile->PushPolicyBarrier();
+  }
+
+  ~BuildsystemFileScope()
+  {
+    this->Makefile->PopPolicyBarrier(this->ReportError);
+  }
+
+  void Quiet() { this->ReportError = false; }
+private:
+  cmMakefile* Makefile;
+  bool ReportError;
+};
+
 bool cmMakefile::ProcessBuildsystemFile(const char* filename)
 {
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename);
@@ -417,10 +437,12 @@ bool cmMakefile::ProcessBuildsystemFile(const char* filename)
     {
     return false;
     }
-
-  this->PushPolicyBarrier();
+  BuildsystemFileScope scope(this);
   this->ReadListFile(listFile, filename);
-  this->PopPolicyBarrier(!cmSystemTools::GetFatalErrorOccured());
+  if(cmSystemTools::GetFatalErrorOccured())
+    {
+    scope.Quiet();
+    }
   this->EnforceDirectoryLevelRules();
   return true;
 }
@@ -576,6 +598,27 @@ bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
   return true;
 }
 
+class cmMakefile::ListFileScope
+{
+public:
+  ListFileScope(cmMakefile* mf)
+    : Makefile(mf), ReportError(true)
+  {
+    this->Makefile->PushPolicyBarrier();
+  }
+
+  ~ListFileScope()
+  {
+    this->Makefile->PopPolicyBarrier(this->ReportError);
+    this->Makefile->ListFileStack.pop_back();
+  }
+
+  void Quiet() { this->ReportError = false; }
+private:
+  cmMakefile* Makefile;
+  bool ReportError;
+};
+
 bool cmMakefile::ReadListFile(const char* filename)
 {
   std::string filenametoread =
@@ -590,10 +633,12 @@ bool cmMakefile::ReadListFile(const char* filename)
     return false;
     }
 
-  this->PushPolicyBarrier();
+  ListFileScope scope(this);
   this->ReadListFile(listFile, filenametoread);
-  this->PopPolicyBarrier(!cmSystemTools::GetFatalErrorOccured());
-  this->ListFileStack.pop_back();
+  if(cmSystemTools::GetFatalErrorOccured())
+    {
+    scope.Quiet();
+    }
   return true;
 }
 
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 85f117b..64783e5 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -968,6 +968,10 @@ private:
   friend class cmCMakePolicyCommand;
   class IncludeScope;
   friend class IncludeScope;
+  class ListFileScope;
+  friend class ListFileScope;
+  class BuildsystemFileScope;
+  friend class BuildsystemFileScope;
 
   // stack of policy settings
   struct PolicyStackEntry: public cmPolicies::PolicyMap

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=276c62253e3f25eda4acbf0049a70c7d622c9ea2
commit 276c62253e3f25eda4acbf0049a70c7d622c9ea2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jun 21 22:46:42 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jun 30 23:14:17 2015 +0200

    cmMakefile: Move the IncludeScope to where it is used.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index a3ba134..5225605 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -405,6 +405,26 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
   return result;
 }
 
+bool cmMakefile::ProcessBuildsystemFile(const char* filename)
+{
+  this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename);
+  std::string curSrc = this->GetCurrentSourceDirectory();
+
+  this->ListFileStack.push_back(filename);
+
+  cmListFile listFile;
+  if (!listFile.ParseFile(filename, curSrc == this->GetHomeDirectory(), this))
+    {
+    return false;
+    }
+
+  this->PushPolicyBarrier();
+  this->ReadListFile(listFile, filename);
+  this->PopPolicyBarrier(!cmSystemTools::GetFatalErrorOccured());
+  this->EnforceDirectoryLevelRules();
+  return true;
+}
+
 //----------------------------------------------------------------------------
 class cmMakefile::IncludeScope
 {
@@ -532,26 +552,6 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
     }
 }
 
-bool cmMakefile::ProcessBuildsystemFile(const char* filename)
-{
-  this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename);
-  std::string curSrc = this->GetCurrentSourceDirectory();
-
-  this->ListFileStack.push_back(filename);
-
-  cmListFile listFile;
-  if (!listFile.ParseFile(filename, curSrc == this->GetHomeDirectory(), this))
-    {
-    return false;
-    }
-
-  this->PushPolicyBarrier();
-  this->ReadListFile(listFile, filename);
-  this->PopPolicyBarrier(!cmSystemTools::GetFatalErrorOccured());
-  this->EnforceDirectoryLevelRules();
-  return true;
-}
-
 bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
 {
   this->AddDefinition("CMAKE_PARENT_LIST_FILE",

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGlobalGenerator.cxx |    1 +
 Source/cmMakefile.cxx        |  131 +++++++++++++++++++++++-------------------
 Source/cmMakefile.h          |   22 ++-----
 3 files changed, 80 insertions(+), 74 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list