summaryrefslogtreecommitdiff
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-20 19:13:52 +0200
committerStephen Kelly <steveire@gmail.com>2015-10-20 23:40:12 +0200
commitd6a03b475e023da9b7532a5b8735caec36b5de86 (patch)
tree5a7fce28bcc989ae6a841118b2031f162ae3b705 /Source/cmMakefile.cxx
parent22bfb39dea2476df8f7aa5ed5c773a7a6720c4bc (diff)
downloadcmake-d6a03b475e023da9b7532a5b8735caec36b5de86.tar.gz
cmIfCommand: Issue CMP0054 warning with appropriate context. (#15802)
Commit v3.4.0-rc1~494^2~4 (cmMakefile: Add API for elseif to create backtrace., 2015-05-29) removed the use of cmMakefileCall to push/pop execution context in favor of a new way to create backtraces. However, a call to cmMakefile::GetExecutionContext is still invoked to issue a contextual CMP0054 warning through cmConditionEvaluator. As the elseif is not part of the call stack, this resulted in trying to access an empty vector. Avoid the attempt at getting execution context when evaluating elseif by constructing a context and backtrace on behalf of the cmConditionEvaluator in all cases.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 077470da92..cb66a75a27 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4658,9 +4658,10 @@ bool cmMakefile::SetPolicyVersion(const char *version)
}
//----------------------------------------------------------------------------
-bool cmMakefile::HasCMP0054AlreadyBeenReported() const
+bool cmMakefile::HasCMP0054AlreadyBeenReported(
+ cmListFileContext const& context) const
{
- return !this->CMP0054ReportedIds.insert(this->GetExecutionContext()).second;
+ return !this->CMP0054ReportedIds.insert(context).second;
}
//----------------------------------------------------------------------------