diff options
| author | Brad King <brad.king@kitware.com> | 2015-06-22 15:46:00 (GMT) |
|---|---|---|
| committer | Brad King <brad.king@kitware.com> | 2015-06-22 15:46:00 (GMT) |
| commit | a38c2711e9110b5b8d8122cdf1aaf25d65f5ea3b (patch) | |
| tree | f13d7a9c8356b510762a41d7893acb1bcab0090f /Source/cmForEachCommand.cxx | |
| parent | b3de2a8e6451c9138948c23a974740823ade8263 (diff) | |
| parent | 5d85fb4f407cd661fb904f68e2c9cc27ddcc0331 (diff) | |
| download | CMake-a38c2711e9110b5b8d8122cdf1aaf25d65f5ea3b.zip CMake-a38c2711e9110b5b8d8122cdf1aaf25d65f5ea3b.tar.gz CMake-a38c2711e9110b5b8d8122cdf1aaf25d65f5ea3b.tar.bz2 | |
Merge branch 'fix-function-missing-end' into release-3.2
Diffstat (limited to 'Source/cmForEachCommand.cxx')
| -rw-r--r-- | Source/cmForEachCommand.cxx | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 8e3510d..33cb234 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -13,6 +13,17 @@ #include <cmsys/auto_ptr.hxx> +cmForEachFunctionBlocker::cmForEachFunctionBlocker(cmMakefile* mf): + Makefile(mf), Depth(0) +{ + this->Makefile->PushLoopBlock(); +} + +cmForEachFunctionBlocker::~cmForEachFunctionBlocker() +{ + this->Makefile->PopLoopBlock(); +} + bool cmForEachFunctionBlocker:: IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, cmExecutionStatus &inStatus) @@ -27,8 +38,6 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, // if this is the endofreach for this statement if (!this->Depth) { - cmMakefile::LoopBlockPop loopBlockPop(&mf); - // Remove the function blocker for this scope or bail. cmsys::auto_ptr<cmFunctionBlocker> fb(mf.RemoveFunctionBlocker(this, lff)); @@ -130,7 +139,7 @@ bool cmForEachCommand } // create a function blocker - cmForEachFunctionBlocker *f = new cmForEachFunctionBlocker(); + cmForEachFunctionBlocker *f = new cmForEachFunctionBlocker(this->Makefile); if ( args.size() > 1 ) { if ( args[1] == "RANGE" ) @@ -206,15 +215,14 @@ bool cmForEachCommand } this->Makefile->AddFunctionBlocker(f); - this->Makefile->PushLoopBlock(); - return true; } //---------------------------------------------------------------------------- bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args) { - cmsys::auto_ptr<cmForEachFunctionBlocker> f(new cmForEachFunctionBlocker()); + cmsys::auto_ptr<cmForEachFunctionBlocker> + f(new cmForEachFunctionBlocker(this->Makefile)); f->Args.push_back(args[0]); enum Doing { DoingNone, DoingLists, DoingItems }; @@ -252,7 +260,5 @@ bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args) this->Makefile->AddFunctionBlocker(f.release()); // TODO: pass auto_ptr - this->Makefile->PushLoopBlock(); - return true; } |
