diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b228e2b480..51a4b3b7ee 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4188,6 +4188,18 @@ void cmMakefile::RaiseScope(const std::string& var, const char* varDef) #endif } +void cmMakefile::RaiseScope(const std::vector& 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) diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 10432a8d74..1763177778 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -880,6 +880,7 @@ public: { this->RaiseScope(var, value.GetCStr()); } + void RaiseScope(const std::vector& variables); // push and pop loop scopes void PushLoopBlockBarrier();