diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-08-02 09:41:51 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-08-28 16:44:39 (GMT) |
commit | ff8ac8ee6ab3ee686621445456a765fa33c1a873 (patch) | |
tree | 35e36e25e7211e74f550fd9416f37a33b34074ca /Source/CTest | |
parent | 0bd7279fd9608702b7790822c80f3c284de8e7e4 (diff) | |
download | CMake-ff8ac8ee6ab3ee686621445456a765fa33c1a873.zip CMake-ff8ac8ee6ab3ee686621445456a765fa33c1a873.tar.gz CMake-ff8ac8ee6ab3ee686621445456a765fa33c1a873.tar.bz2 |
cmLocalGenerator: Create from already-constructed cmMakefile.
Don't manage the lifetime of the cmMakefile with cmLocalGenerator.
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestLaunch.cxx | 4 | ||||
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 10 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 4 |
3 files changed, 10 insertions, 8 deletions
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 7340d5c..fb0cce6 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -738,9 +738,9 @@ void cmCTestLaunch::LoadConfig() cm.SetHomeDirectory(""); cm.SetHomeOutputDirectory(""); cmGlobalGenerator gg(&cm); + cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot())); cmsys::auto_ptr<cmLocalGenerator> lg( - gg.CreateLocalGenerator(cm.GetCurrentSnapshot())); - cmMakefile* mf = lg->GetMakefile(); + gg.CreateLocalGenerator(mf.get())); std::string fname = this->LogDir; fname += "CTestLaunchConfig.cmake"; if(cmSystemTools::FileExists(fname.c_str()) && diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 4be5eb6..c1ba279 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -125,6 +125,7 @@ void cmCTestScriptHandler::Initialize() // what time in seconds did this script start running this->ScriptStartTime = 0; + delete this->Makefile; this->Makefile = 0; delete this->LocalGenerator; @@ -139,8 +140,7 @@ void cmCTestScriptHandler::Initialize() //---------------------------------------------------------------------- cmCTestScriptHandler::~cmCTestScriptHandler() { - // local generator owns the makefile - this->Makefile = 0; + delete this->Makefile; delete this->LocalGenerator; delete this->GlobalGenerator; delete this->CMake; @@ -317,6 +317,7 @@ void cmCTestScriptHandler::CreateCMake() delete this->CMake; delete this->GlobalGenerator; delete this->LocalGenerator; + delete this->Makefile; } this->CMake = new cmake; this->CMake->SetHomeDirectory(""); @@ -325,8 +326,9 @@ void cmCTestScriptHandler::CreateCMake() this->GlobalGenerator = new cmGlobalGenerator(this->CMake); cmState::Snapshot snapshot = this->CMake->GetCurrentSnapshot(); - this->LocalGenerator = this->GlobalGenerator->CreateLocalGenerator(snapshot); - this->Makefile = this->LocalGenerator->GetMakefile(); + this->Makefile = new cmMakefile(this->GlobalGenerator, snapshot); + this->LocalGenerator = + this->GlobalGenerator->CreateLocalGenerator(this->Makefile); this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest); diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 9e00193..a523f57 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1592,9 +1592,9 @@ void cmCTestTestHandler::GetListOfTests() cm.SetHomeDirectory(""); cm.SetHomeOutputDirectory(""); cmGlobalGenerator gg(&cm); + cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot())); cmsys::auto_ptr<cmLocalGenerator> lg( - gg.CreateLocalGenerator(cm.GetCurrentSnapshot())); - cmMakefile *mf = lg->GetMakefile(); + gg.CreateLocalGenerator(mf.get())); mf->AddDefinition("CTEST_CONFIGURATION_TYPE", this->CTest->GetConfigType().c_str()); |