cmMakefile: add RaiseScope for list of variables

This commit is contained in:
Marc Chevrier
2022-08-20 11:34:19 +02:00
parent b4c5b5a5f9
commit 8f0e1f2111
2 changed files with 13 additions and 0 deletions

View File

@@ -4188,6 +4188,18 @@ void cmMakefile::RaiseScope(const std::string& var, const char* varDef)
#endif
}
void cmMakefile::RaiseScope(const std::vector<std::string>& variables)
{
for (auto const& varName : variables) {
if (this->IsNormalDefinitionSet(varName)) {
this->RaiseScope(varName, this->GetDefinition(varName));
} else {
// unset variable in parent scope
this->RaiseScope(varName, nullptr);
}
}
}
cmTarget* cmMakefile::AddImportedTarget(const std::string& name,
cmStateEnums::TargetType type,
bool global)

View File

@@ -880,6 +880,7 @@ public:
{
this->RaiseScope(var, value.GetCStr());
}
void RaiseScope(const std::vector<std::string>& variables);
// push and pop loop scopes
void PushLoopBlockBarrier();