diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-04-25 12:22:09 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2021-04-28 17:44:25 (GMT) |
commit | 46896d98bb8ed8a1068da70220581f8bbc3847fc (patch) | |
tree | 690472b077e8863afabc0647e909b52a8e32f02d /Source/cmMakefile.cxx | |
parent | 49c6d0f26199c252b493ed5f816dbcb2e9701112 (diff) | |
download | CMake-46896d98bb8ed8a1068da70220581f8bbc3847fc.zip CMake-46896d98bb8ed8a1068da70220581f8bbc3847fc.tar.gz CMake-46896d98bb8ed8a1068da70220581f8bbc3847fc.tar.bz2 |
foreach(): loop variables are only available in the loop scope
Fixes: #20553
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 40a67a3..dba8560 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); |