summaryrefslogtreecommitdiff
path: root/Source/cmIfCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-01-21 09:49:00 -0500
committerBrad King <brad.king@kitware.com>2009-01-21 09:49:00 -0500
commit1dcc5b455829db89f0d931cd57c12e0e247c0f44 (patch)
tree65b04dafe29a8a753be2824ea7f4f985d0fc43fb /Source/cmIfCommand.cxx
parentbca1026250c5d2006a3829662b736660982e3a33 (diff)
downloadcmake-1dcc5b455829db89f0d931cd57c12e0e247c0f44.tar.gz
ENH: Better handling of mismatched blocks
If a logical block terminates with mismatching arguments we previously failed to remove the function blocker but replayed the commands anyway, which led to cases in which we failed to report the mismatch (return shortly after the ending command). The recent refactoring of function blocker deletion changed this behavior to produce an error on the ending line by not blocking the command. Furthermore, the function blocker would stay in place and complain at the end of every equal-level block of the same type. This teaches CMake to treat the begin/end commands (if/endif, etc.) as correct and just warns when the arguments mismatch. The change allows cases in which CMake 2.6.2 silently ignored a mismatch to run as before but with a warning.
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r--Source/cmIfCommand.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 74576b5aed..607031e576 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -39,7 +39,8 @@ IsFunctionBlocked(const cmListFileFunction& lff,
if (!this->ScopeDepth)
{
// Remove the function blocker for this scope or bail.
- cmsys::auto_ptr<cmFunctionBlocker> fb(mf.RemoveFunctionBlocker(lff));
+ cmsys::auto_ptr<cmFunctionBlocker>
+ fb(mf.RemoveFunctionBlocker(this, lff));
if(!fb.get()) { return false; }
// execute the functions for the true parts of the if statement