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/cmGlobalUnixMakefileGenerator3.cxx | |
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/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 0d4ee15..cf4fd69 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -60,9 +60,9 @@ void cmGlobalUnixMakefileGenerator3 ///! Create a local generator appropriate to this Global Generator cmLocalGenerator* cmGlobalUnixMakefileGenerator3::CreateLocalGenerator( - cmState::Snapshot snapshot) + cmMakefile* mf) { - return new cmLocalUnixMakefileGenerator3(this, snapshot); + return new cmLocalUnixMakefileGenerator3(this, mf); } //---------------------------------------------------------------------------- @@ -577,17 +577,20 @@ void cmGlobalUnixMakefileGenerator3 makeOptions.begin(), makeOptions.end()); if (!targetName.empty()) { + cmMakefile* mf; cmLocalUnixMakefileGenerator3 *lg; if (!this->LocalGenerators.empty()) { lg = static_cast<cmLocalUnixMakefileGenerator3 *> (this->LocalGenerators[0]); + mf = lg->GetMakefile(); } else { cmState::Snapshot snapshot = this->CMakeInstance->GetCurrentSnapshot(); + mf = new cmMakefile(this, snapshot); lg = static_cast<cmLocalUnixMakefileGenerator3 *> - (this->CreateLocalGenerator(snapshot)); + (this->CreateLocalGenerator(mf)); // set the Start directories lg->GetMakefile()->SetCurrentSourceDirectory (this->CMakeInstance->GetHomeDirectory()); @@ -606,6 +609,7 @@ void cmGlobalUnixMakefileGenerator3 if (this->LocalGenerators.empty()) { delete lg; + delete mf; } } } |