summaryrefslogtreecommitdiff
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2021-04-25 14:22:09 +0200
committerMarc Chevrier <marc.chevrier@gmail.com>2021-04-28 19:44:25 +0200
commit46896d98bb8ed8a1068da70220581f8bbc3847fc (patch)
tree690472b077e8863afabc0647e909b52a8e32f02d /Source/cmMakefile.cxx
parent49c6d0f26199c252b493ed5f816dbcb2e9701112 (diff)
downloadcmake-46896d98bb8ed8a1068da70220581f8bbc3847fc.tar.gz
foreach(): loop variables are only available in the loop scope
Fixes: #20553
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 40a67a399d..dba856037f 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2507,6 +2507,20 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const
return def != nullptr;
}
+bool cmMakefile::IsNormalDefinitionSet(const std::string& name) const
+{
+ cmProp def = this->StateSnapshot.GetDefinition(name);
+#ifndef CMAKE_BOOTSTRAP
+ if (cmVariableWatch* vv = this->GetVariableWatch()) {
+ if (!def) {
+ vv->VariableAccessed(
+ name, cmVariableWatch::UNKNOWN_VARIABLE_DEFINED_ACCESS, nullptr, this);
+ }
+ }
+#endif
+ return def != nullptr;
+}
+
cmProp cmMakefile::GetDefinition(const std::string& name) const
{
cmProp def = this->StateSnapshot.GetDefinition(name);