BUG: Make RAISE_SCOPE function work when variable is not defined.

This commit is contained in:
Brad King
2008-01-02 17:49:16 -05:00
parent ec05369d04
commit dcd9a1b59f
3 changed files with 46 additions and 2 deletions
+16 -2
View File
@@ -2853,7 +2853,14 @@ void cmMakefile::RaiseScope(const char *var)
// multiple scopes in this directory?
if (this->DefinitionStack.size() > 1)
{
this->DefinitionStack[this->DefinitionStack.size()-2][var] = varDef;
if(varDef)
{
this->DefinitionStack[this->DefinitionStack.size()-2][var] = varDef;
}
else
{
this->DefinitionStack[this->DefinitionStack.size()-2].erase(var);
}
}
// otherwise do the parent
else
@@ -2861,7 +2868,14 @@ void cmMakefile::RaiseScope(const char *var)
cmMakefile *parent = this->LocalGenerator->GetParent()->GetMakefile();
if (parent)
{
parent->AddDefinition(var,varDef);
if(varDef)
{
parent->AddDefinition(var,varDef);
}
else
{
parent->RemoveDefinition(var);
}
}
}
}