[Cmake-commits] [cmake-commits] king committed cmMakefile.cxx 1.489 1.490 cmMakefile.h 1.240 1.241

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Jan 15 14:37:19 EST 2009


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv17314/Source

Modified Files:
	cmMakefile.cxx cmMakefile.h 
Log Message:
BUG: Enforce matching policy PUSH/POP in all files

The documentation of cmake_policy PUSH and POP states that they must
always match.  Previously we enforced this only for the top scope of
each CMakeLists.txt file.  This enforces the requirement for all files.


Index: cmMakefile.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.h,v
retrieving revision 1.240
retrieving revision 1.241
diff -C 2 -d -r1.240 -r1.241
*** cmMakefile.h	14 Jan 2009 20:14:06 -0000	1.240
--- cmMakefile.h	15 Jan 2009 19:37:14 -0000	1.241
***************
*** 919,923 ****
  
    // Enforce rules about CMakeLists.txt files.
!   void EnforceDirectoryLevelRules(bool endScopeNicely);
  };
  
--- 919,923 ----
  
    // Enforce rules about CMakeLists.txt files.
!   void EnforceDirectoryLevelRules();
  };
  

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.489
retrieving revision 1.490
diff -C 2 -d -r1.489 -r1.490
*** cmMakefile.cxx	15 Jan 2009 13:57:44 -0000	1.489
--- cmMakefile.cxx	15 Jan 2009 19:37:08 -0000	1.490
***************
*** 563,566 ****
--- 563,571 ----
    this->ListFiles.push_back( filenametoread);
    bool endScopeNicely = true;
+ 
+   // Save the current policy stack depth.
+   size_t const policy_depth = this->PolicyStack.size();
+ 
+   // Run the parsed commands.
    const size_t numberFunctions = cacheFile.Functions.size();
    for(size_t i =0; i < numberFunctions; ++i)
***************
*** 577,580 ****
--- 582,596 ----
      }
  
+   // Restore policy stack depth.
+   while(this->PolicyStack.size() > policy_depth)
+     {
+     if(endScopeNicely)
+       {
+       this->IssueMessage(cmake::FATAL_ERROR,
+                          "cmake_policy PUSH without matching POP");
+       }
+     this->PopPolicy(false);
+     }
+ 
    // send scope ended to and function blockers
    if (endScopeNicely)
***************
*** 598,602 ****
    if(this->ListFileStack.size() == 1)
      {
!     this->EnforceDirectoryLevelRules(endScopeNicely);
      }
  
--- 614,618 ----
    if(this->ListFileStack.size() == 1)
      {
!     this->EnforceDirectoryLevelRules();
      }
  
***************
*** 611,627 ****
  
  //----------------------------------------------------------------------------
! void cmMakefile::EnforceDirectoryLevelRules(bool endScopeNicely)
  {
-   // Enforce policy stack depth.
-   while(this->PolicyStack.size() > 1)
-     {
-     if(endScopeNicely)
-       {
-       this->IssueMessage(cmake::FATAL_ERROR,
-                          "cmake_policy PUSH without matching POP");
-       }
-     this->PopPolicy(false);
-     }
- 
    // Diagnose a violation of CMP0000 if necessary.
    if(this->CheckCMP0000)
--- 627,632 ----
  
  //----------------------------------------------------------------------------
! void cmMakefile::EnforceDirectoryLevelRules()
  {
    // Diagnose a violation of CMP0000 if necessary.
    if(this->CheckCMP0000)



More information about the Cmake-commits mailing list