Makefiles: Remove need to create local generator at configure time.

This method is used during try_compile.
This commit is contained in:
Stephen Kelly 2015-09-24 09:35:55 +02:00
parent 61b48e70bc
commit 934aa454d0
1 changed files with 5 additions and 11 deletions

View File

@ -578,23 +578,18 @@ void cmGlobalUnixMakefileGenerator3
if (!targetName.empty()) if (!targetName.empty())
{ {
cmMakefile* mf; cmMakefile* mf;
cmLocalUnixMakefileGenerator3 *lg; if (!this->Makefiles.empty())
if (!this->LocalGenerators.empty())
{ {
lg = static_cast<cmLocalUnixMakefileGenerator3 *> mf = this->Makefiles[0];
(this->LocalGenerators[0]);
mf = lg->GetMakefile();
} }
else else
{ {
cmState::Snapshot snapshot = this->CMakeInstance->GetCurrentSnapshot(); cmState::Snapshot snapshot = this->CMakeInstance->GetCurrentSnapshot();
mf = new cmMakefile(this, snapshot); mf = new cmMakefile(this, snapshot);
lg = static_cast<cmLocalUnixMakefileGenerator3 *>
(this->CreateLocalGenerator(mf));
// set the Start directories // set the Start directories
lg->GetMakefile()->SetCurrentSourceDirectory mf->SetCurrentSourceDirectory
(this->CMakeInstance->GetHomeDirectory()); (this->CMakeInstance->GetHomeDirectory());
lg->GetMakefile()->SetCurrentBinaryDirectory mf->SetCurrentBinaryDirectory
(this->CMakeInstance->GetHomeOutputDirectory()); (this->CMakeInstance->GetHomeOutputDirectory());
} }
@ -607,9 +602,8 @@ void cmGlobalUnixMakefileGenerator3
tname = conv.Convert(tname,cmOutputConverter::HOME_OUTPUT); tname = conv.Convert(tname,cmOutputConverter::HOME_OUTPUT);
cmSystemTools::ConvertToOutputSlashes(tname); cmSystemTools::ConvertToOutputSlashes(tname);
makeCommand.push_back(tname); makeCommand.push_back(tname);
if (this->LocalGenerators.empty()) if (this->Makefiles.empty())
{ {
delete lg;
delete mf; delete mf;
} }
} }