cmake: Remove needless cmLocalGenerator creation.

This commit is contained in:
Stephen Kelly 2015-10-05 20:52:26 +02:00
parent 3339a7508e
commit 0a73044579
1 changed files with 5 additions and 7 deletions

View File

@ -378,20 +378,19 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory()); this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
cmState::Snapshot snapshot = this->GetCurrentSnapshot(); cmState::Snapshot snapshot = this->GetCurrentSnapshot();
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(gg, snapshot)); cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(gg, snapshot));
cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator(mf.get())); mf->SetCurrentBinaryDirectory
lg->GetMakefile()->SetCurrentBinaryDirectory
(cmSystemTools::GetCurrentWorkingDirectory()); (cmSystemTools::GetCurrentWorkingDirectory());
lg->GetMakefile()->SetCurrentSourceDirectory mf->SetCurrentSourceDirectory
(cmSystemTools::GetCurrentWorkingDirectory()); (cmSystemTools::GetCurrentWorkingDirectory());
if (this->GetWorkingMode() != NORMAL_MODE) if (this->GetWorkingMode() != NORMAL_MODE)
{ {
std::string file(cmSystemTools::CollapseFullPath(path)); std::string file(cmSystemTools::CollapseFullPath(path));
cmSystemTools::ConvertToUnixSlashes(file); cmSystemTools::ConvertToUnixSlashes(file);
lg->GetMakefile()->SetScriptModeFile(file.c_str()); mf->SetScriptModeFile(file.c_str());
lg->GetMakefile()->SetArgcArgv(args); mf->SetArgcArgv(args);
} }
if (!lg->GetMakefile()->ReadListFile(path)) if (!mf->ReadListFile(path))
{ {
cmSystemTools::Error("Error processing file: ", path); cmSystemTools::Error("Error processing file: ", path);
} }
@ -1906,7 +1905,6 @@ int cmake::CheckBuildSystem()
cm.SetHomeOutputDirectory(""); cm.SetHomeOutputDirectory("");
cmGlobalGenerator gg(&cm); cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot())); cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
cmsys::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator(mf.get()));
if(!mf->ReadListFile(this->CheckBuildSystemArgument.c_str()) || if(!mf->ReadListFile(this->CheckBuildSystemArgument.c_str()) ||
cmSystemTools::GetErrorOccuredFlag()) cmSystemTools::GetErrorOccuredFlag())
{ {