Browse Source

cmMakefile: Extract an accessor for the global generator.

Both for convenience, and because cmMakefile should not be the
way to get access to the local generator, so that should go away
in the future.
Stephen Kelly 10 years ago
parent
commit
0bb6dbe0c6
2 changed files with 7 additions and 1 deletions
  1. 6 1
      Source/cmMakefile.cxx
  2. 1 0
      Source/cmMakefile.h

+ 6 - 1
Source/cmMakefile.cxx

@@ -3693,7 +3693,12 @@ bool cmMakefile::GetIsSourceFileTryCompile() const
 
 
 cmake *cmMakefile::GetCMakeInstance() const
 cmake *cmMakefile::GetCMakeInstance() const
 {
 {
-  return this->LocalGenerator->GetGlobalGenerator()->GetCMakeInstance();
+  return this->GetGlobalGenerator()->GetCMakeInstance();
+}
+
+cmGlobalGenerator* cmMakefile::GetGlobalGenerator() const
+{
+  return this->LocalGenerator->GetGlobalGenerator();
 }
 }
 
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
 #ifdef CMAKE_BUILD_WITH_CMAKE

+ 1 - 0
Source/cmMakefile.h

@@ -712,6 +712,7 @@ public:
    * Get the instance
    * Get the instance
    */
    */
   cmake *GetCMakeInstance() const;
   cmake *GetCMakeInstance() const;
+  cmGlobalGenerator* GetGlobalGenerator() const;
 
 
   /**
   /**
    * Get all the source files this makefile knows about
    * Get all the source files this makefile knows about