cmLocalGenerator: De-virtualize Configure().

The generators that override it do so in order to populate
data members which can instead be populated in Generate().
This commit is contained in:
Stephen Kelly 2015-05-30 19:12:38 +02:00 committed by Brad King
parent 6e570f857a
commit 363caa2fa5
5 changed files with 11 additions and 34 deletions

View File

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

View File

@ -41,6 +41,15 @@ cmLocalNinjaGenerator::~cmLocalNinjaGenerator()
void cmLocalNinjaGenerator::Generate() 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->SetConfigName();
this->WriteProcessedMakefile(this->GetBuildFileStream()); this->WriteProcessedMakefile(this->GetBuildFileStream());
@ -91,25 +100,6 @@ void cmLocalNinjaGenerator::Generate()
this->WriteCustomCommandBuildStatements(); 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. // TODO: Picked up from cmLocalUnixMakefileGenerator3. Refactor it.
std::string cmLocalNinjaGenerator std::string cmLocalNinjaGenerator
::GetTargetDirectory(cmTarget const& target) const ::GetTargetDirectory(cmTarget const& target) const

View File

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

View File

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

View File

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