cmMakefile: Simplify InitializeFromParent method.

Provide a parent instead of requiring it to be computed through
the cmLocalGenerator.
This commit is contained in:
Stephen Kelly 2015-06-06 09:17:45 +02:00
parent 353e422b2a
commit 1981c9718b
2 changed files with 3 additions and 5 deletions

View File

@ -1485,10 +1485,8 @@ void cmMakefile::AddLinkDirectory(const std::string& dir)
} }
} }
void cmMakefile::InitializeFromParent() void cmMakefile::InitializeFromParent(cmMakefile* parent)
{ {
cmMakefile *parent = this->LocalGenerator->GetParent()->GetMakefile();
// Initialize definitions with the closure of the parent scope. // Initialize definitions with the closure of the parent scope.
this->Internal->InitializeDefinitions(parent); this->Internal->InitializeDefinitions(parent);
@ -1672,7 +1670,7 @@ void cmMakefile::Configure()
void cmMakefile::ConfigureSubDirectory(cmMakefile *mf) void cmMakefile::ConfigureSubDirectory(cmMakefile *mf)
{ {
mf->InitializeFromParent(); mf->InitializeFromParent(this);
std::string currentStart = mf->GetCurrentSourceDirectory(); std::string currentStart = mf->GetCurrentSourceDirectory();
if (this->GetCMakeInstance()->GetDebugOutput()) if (this->GetCMakeInstance()->GetDebugOutput())
{ {

View File

@ -728,7 +728,7 @@ public:
cmPropertyMap &GetProperties() { return this->Properties; } cmPropertyMap &GetProperties() { return this->Properties; }
///! Initialize a makefile from its parent ///! Initialize a makefile from its parent
void InitializeFromParent(); void InitializeFromParent(cmMakefile* parent);
void AddInstallGenerator(cmInstallGenerator* g) void AddInstallGenerator(cmInstallGenerator* g)
{ if(g) this->InstallGenerators.push_back(g); } { if(g) this->InstallGenerators.push_back(g); }