summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-11-07 12:27:49 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-11-07 12:28:02 (GMT)
commitcf78a7df952a8d7be4228cb1c4a4b38ebc63dae8 (patch)
treec127a5b758ed4e74b575687729043a50262055fc /Source
parentbb8da283ce40d3bb06df348ea2820dd12213a2e1 (diff)
parent53a5aec89998a58dff53946b47426ea692c5ad8d (diff)
downloadCMake-cf78a7df952a8d7be4228cb1c4a4b38ebc63dae8.zip
CMake-cf78a7df952a8d7be4228cb1c4a4b38ebc63dae8.tar.gz
CMake-cf78a7df952a8d7be4228cb1c4a4b38ebc63dae8.tar.bz2
Merge topic 'fix-double-warn-uninitialized-in-script-mode'
53a5aec899 CMP0053: Fix double warning on uninitialized variables in -P mode f92f93467e cmMakefile: Rename SuppressWatches to SuppressSideEffects Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2565
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx10
-rw-r--r--Source/cmMakefile.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0a69d09..0d42fb0 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -67,7 +67,7 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused();
this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars();
- this->SuppressWatches = false;
+ this->SuppressSideEffects = false;
// Setup the default include complaint regular expression (match nothing).
this->ComplainFileRegularExpression = "^$";
@@ -2421,7 +2421,7 @@ const std::string* cmMakefile::GetDef(const std::string& name) const
}
#ifdef CMAKE_BUILD_WITH_CMAKE
cmVariableWatch* vv = this->GetVariableWatch();
- if (vv && !this->SuppressWatches) {
+ if (vv && !this->SuppressSideEffects) {
bool const watch_function_executed =
vv->VariableAccessed(name,
def ? cmVariableWatch::VARIABLE_READ_ACCESS
@@ -2508,11 +2508,11 @@ const std::string& cmMakefile::ExpandVariablesInString(
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;
+ this->SuppressSideEffects = true;
newError = ExpandVariablesInStringNew(
newErrorstr, newResult, escapeQuotes, noEscapes, atOnly, filename,
line, removeEmpty, replaceAt);
- this->SuppressWatches = false;
+ this->SuppressSideEffects = false;
CM_FALLTHROUGH;
}
case cmPolicies::OLD:
@@ -2766,7 +2766,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
} else {
varresult = value;
}
- } else if (!removeEmpty) {
+ } else if (!removeEmpty && !this->SuppressSideEffects) {
// check to see if we need to print a warning
// if strict mode is on and the variable has
// not been "cleared"/initialized with a set(foo ) call
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index b30f281..d8176d9 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -1025,7 +1025,7 @@ private:
bool CheckCMP0000;
std::set<std::string> WarnedCMP0074;
bool IsSourceFileTryCompile;
- mutable bool SuppressWatches;
+ mutable bool SuppressSideEffects;
};
#endif