summaryrefslogtreecommitdiffstats
path: root/Source/cmForEachCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-11-26 18:50:47 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-11-26 18:50:47 (GMT)
commit82582c96bd86969ee5e1cc6f7bc4e5b12e1717e1 (patch)
tree3b47d49ccd16f09b7281f16600d553ea8b44b630 /Source/cmForEachCommand.cxx
parent106c769f1d46a2410ff62c3dd4cd02cd1da7fd37 (diff)
parentd54617d0068fc5acfa2079d1e8de8f38365564ab (diff)
downloadCMake-82582c96bd86969ee5e1cc6f7bc4e5b12e1717e1.zip
CMake-82582c96bd86969ee5e1cc6f7bc4e5b12e1717e1.tar.gz
CMake-82582c96bd86969ee5e1cc6f7bc4e5b12e1717e1.tar.bz2
Merge topic 'break-command-strictness'
d54617d0 break: Add policy CMP0055 to check calls strictly bae604d9 Track nested loop levels in CMake language with a stack of counters
Diffstat (limited to 'Source/cmForEachCommand.cxx')
-rw-r--r--Source/cmForEachCommand.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index e3f66c1..dec5157 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -27,6 +27,8 @@ 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));
@@ -73,6 +75,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
}
}
}
+
// restore the variable to its prior value
mf.AddDefinition(this->Args[0],oldDef.c_str());
return true;
@@ -199,6 +202,8 @@ bool cmForEachCommand
}
this->Makefile->AddFunctionBlocker(f);
+ this->Makefile->PushLoopBlock();
+
return true;
}
@@ -242,5 +247,8 @@ bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args)
}
this->Makefile->AddFunctionBlocker(f.release()); // TODO: pass auto_ptr
+
+ this->Makefile->PushLoopBlock();
+
return true;
}