summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx8
-rw-r--r--Source/cmMakefile.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9f33b92..3510dcb 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -103,6 +103,7 @@ cmMakefile::cmMakefile(): Internal(new Internals)
this->GeneratingBuildSystem = false;
this->NumLastMatches = 0;
+ this->SuppressWatches = false;
}
cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals)
@@ -153,6 +154,7 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals)
this->OutputToSource = mf.OutputToSource;
this->NumLastMatches = mf.NumLastMatches;
+ this->SuppressWatches = mf.SuppressWatches;
}
//----------------------------------------------------------------------------
@@ -2463,7 +2465,7 @@ const char* cmMakefile::GetDefinition(const std::string& name) const
}
#ifdef CMAKE_BUILD_WITH_CMAKE
cmVariableWatch* vv = this->GetVariableWatch();
- if ( vv )
+ if ( vv && !this->SuppressWatches )
{
if ( def )
{
@@ -2570,10 +2572,14 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source,
original = source;
newResult = source;
compareResults = true;
+ // Suppress variable watches to avoid calling hooks twice. Suppress new
+ // dereferences since the OLD behavior is still what is actually used.
+ this->SuppressWatches = true;
newError =
ExpandVariablesInStringNew(newErrorstr, newResult, escapeQuotes,
noEscapes, atOnly, filename, line,
removeEmpty, replaceAt);
+ this->SuppressWatches = false;
}
case cmPolicies::OLD:
mtype = ExpandVariablesInStringOld(errorstr, source, escapeQuotes,
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 11904a6..9a4b9c7 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -1127,6 +1127,8 @@ private:
const std::string& feature) const;
bool HaveCxxFeatureAvailable(cmTarget const* target,
const std::string& feature) const;
+
+ mutable bool SuppressWatches;
};
//----------------------------------------------------------------------------