summaryrefslogtreecommitdiff
path: root/Source/cmCMakePolicyCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-01-22 10:57:16 -0500
committerBrad King <brad.king@kitware.com>2009-01-22 10:57:16 -0500
commitdfc181a1dc0baa3b4f36b64a0b64e68c1a2f636a (patch)
tree4417f27921d73ef74d37a72031c39c2d1c2f873d /Source/cmCMakePolicyCommand.cxx
parentac14b5d2eb995f0cb1cfc1acca9d06ec02cff7d7 (diff)
downloadcmake-dfc181a1dc0baa3b4f36b64a0b64e68c1a2f636a.tar.gz
ENH: Create policy scope barriers
This creates a barrier mechanism to prevent user code from using cmake_policy(POP) to pop a scope it didn't push with cmake_policy(PUSH).
Diffstat (limited to 'Source/cmCMakePolicyCommand.cxx')
-rw-r--r--Source/cmCMakePolicyCommand.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx
index 7672a6ceec..dc99c869ba 100644
--- a/Source/cmCMakePolicyCommand.cxx
+++ b/Source/cmCMakePolicyCommand.cxx
@@ -43,7 +43,8 @@ bool cmCMakePolicyCommand
this->SetError("PUSH may not be given additional arguments.");
return false;
}
- return this->Makefile->PushPolicy();
+ this->Makefile->PushPolicy();
+ return true;
}
else if(args[0] == "POP")
{
@@ -52,15 +53,8 @@ bool cmCMakePolicyCommand
this->SetError("POP may not be given additional arguments.");
return false;
}
- if(this->Makefile->PopPolicy(false))
- {
- return true;
- }
- else
- {
- this->SetError("POP without matching PUSH");
- return false;
- }
+ this->Makefile->PopPolicy();
+ return true;
}
else if(args[0] == "VERSION")
{