summaryrefslogtreecommitdiffstats
path: root/Source/cmIfCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r--Source/cmIfCommand.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index bc82c42..f38d265 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -145,9 +145,10 @@ bool cmIfFunctionBlocker::ShouldRemove(const cmListFileFunction& lff,
{
if (!cmSystemTools::Strucmp(lff.Name.c_str(),"endif"))
{
- if (cmSystemTools::IsOn
- (mf.GetPropertyOrDefinition("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS"))
- || lff.Arguments == this->Args)
+ // if the endif has arguments, then make sure
+ // they match the arguments of the matching if
+ if (lff.Arguments.size() == 0 ||
+ lff.Arguments == this->Args)
{
return true;
}