summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2022-08-20 09:34:19 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2022-09-03 17:27:26 (GMT)
commit8f0e1f2111c046aaa240a54c211404747c911698 (patch)
tree56dd69b0e8bd8f484beebe4f3f6b0ea785c0ecf6
parentb4c5b5a5f9b833f165d431babb26034e35553473 (diff)
downloadCMake-8f0e1f2111c046aaa240a54c211404747c911698.zip
CMake-8f0e1f2111c046aaa240a54c211404747c911698.tar.gz
CMake-8f0e1f2111c046aaa240a54c211404747c911698.tar.bz2
cmMakefile: add RaiseScope for list of variables
-rw-r--r--Source/cmMakefile.cxx12
-rw-r--r--Source/cmMakefile.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index b228e2b..51a4b3b 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<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)
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 10432a8..1763177 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -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();