BUG: Make sure at least one policy stack entry is created for every cmMakefile instance.

This commit is contained in:
Brad King 2008-03-04 18:57:14 -05:00
parent 2f922c6220
commit ddd6ce04ec
1 changed files with 4 additions and 1 deletions

View File

@ -46,6 +46,9 @@ cmMakefile::cmMakefile()
{ {
this->DefinitionStack.push_back(DefinitionMap()); this->DefinitionStack.push_back(DefinitionMap());
// Enter a policy level for this directory.
this->PushPolicy();
// Setup the default include file regular expression (match everything). // Setup the default include file regular expression (match everything).
this->IncludeFileRegularExpression = "^.*$"; this->IncludeFileRegularExpression = "^.*$";
// Setup the default include complaint regular expression (match nothing). // Setup the default include complaint regular expression (match nothing).
@ -3314,7 +3317,7 @@ bool cmMakefile::PushPolicy()
bool cmMakefile::PopPolicy() bool cmMakefile::PopPolicy()
{ {
if (PolicyStack.size() == 0) if (PolicyStack.size() == 1)
{ {
cmSystemTools::Error("Attempt to pop the policy stack past " cmSystemTools::Error("Attempt to pop the policy stack past "
"it's beginning."); "it's beginning.");