mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-23 22:58:37 -05:00
BUG: Make RAISE_SCOPE function work when variable is not defined.
This commit is contained in:
+16
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user