Browse Source

cmLocalGenerator: De-virtualize Configure().

The generators that override it do so in order to populate
data members which can instead be populated in Generate().
Stephen Kelly 10 years ago
parent
commit
363caa2fa5

+ 1 - 1
Source/cmLocalGenerator.h

@@ -50,7 +50,7 @@ public:
    * Process the CMakeLists files for this directory to fill in the
    * Makefile ivar
    */
-  virtual void Configure();
+  void Configure();
 
   /**
    * Calls TraceVSDependencies() on all targets of this generator.

+ 9 - 19
Source/cmLocalNinjaGenerator.cxx

@@ -41,6 +41,15 @@ cmLocalNinjaGenerator::~cmLocalNinjaGenerator()
 
 void cmLocalNinjaGenerator::Generate()
 {
+  // Compute the path to use when referencing the current output
+  // directory from the top output directory.
+  this->HomeRelativeOutputPath =
+    this->Convert(this->Makefile->GetCurrentBinaryDirectory(), HOME_OUTPUT);
+  if(this->HomeRelativeOutputPath == ".")
+    {
+    this->HomeRelativeOutputPath = "";
+    }
+
   this->SetConfigName();
 
   this->WriteProcessedMakefile(this->GetBuildFileStream());
@@ -91,25 +100,6 @@ void cmLocalNinjaGenerator::Generate()
   this->WriteCustomCommandBuildStatements();
 }
 
-// Implemented in:
-//   cmLocalUnixMakefileGenerator3.
-// Used in:
-//   Source/cmMakefile.cxx
-//   Source/cmGlobalGenerator.cxx
-void cmLocalNinjaGenerator::Configure()
-{
-  // Compute the path to use when referencing the current output
-  // directory from the top output directory.
-  this->HomeRelativeOutputPath =
-    this->Convert(this->Makefile->GetCurrentBinaryDirectory(), HOME_OUTPUT);
-  if(this->HomeRelativeOutputPath == ".")
-    {
-    this->HomeRelativeOutputPath = "";
-    }
-  this->cmLocalGenerator::Configure();
-
-}
-
 // TODO: Picked up from cmLocalUnixMakefileGenerator3.  Refactor it.
 std::string cmLocalNinjaGenerator
 ::GetTargetDirectory(cmTarget const& target) const

+ 0 - 2
Source/cmLocalNinjaGenerator.h

@@ -38,8 +38,6 @@ public:
 
   virtual void Generate();
 
-  virtual void Configure();
-
   virtual std::string GetTargetDirectory(cmTarget const& target) const;
 
   const cmGlobalNinjaGenerator* GetGlobalNinjaGenerator() const;

+ 1 - 6
Source/cmLocalUnixMakefileGenerator3.cxx

@@ -98,7 +98,7 @@ cmLocalUnixMakefileGenerator3::~cmLocalUnixMakefileGenerator3()
 }
 
 //----------------------------------------------------------------------------
-void cmLocalUnixMakefileGenerator3::Configure()
+void cmLocalUnixMakefileGenerator3::Generate()
 {
   // Compute the path to use when referencing the current output
   // directory from the top output directory.
@@ -112,12 +112,7 @@ void cmLocalUnixMakefileGenerator3::Configure()
     {
     this->HomeRelativeOutputPath += "/";
     }
-  this->cmLocalGenerator::Configure();
-}
 
-//----------------------------------------------------------------------------
-void cmLocalUnixMakefileGenerator3::Generate()
-{
   // Store the configuration name that will be generated.
   if(const char* config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"))
     {

+ 0 - 6
Source/cmLocalUnixMakefileGenerator3.h

@@ -39,12 +39,6 @@ public:
                                 cmState::Snapshot snapshot);
   virtual ~cmLocalUnixMakefileGenerator3();
 
-  /**
-   * Process the CMakeLists files for this directory to fill in the
-   * Makefile ivar
-   */
-  virtual void Configure();
-
   /**
    * Generate the makefile for this directory.
    */