diff options
author | Brad King <brad.king@kitware.com> | 2015-10-21 13:16:49 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-10-21 13:16:49 (GMT) |
commit | e2d4bfef3fe24ba5846abbb2dc2c2e0ef58a21f5 (patch) | |
tree | dc99dc7c2fdfc9d49ef71c78290afbaf9a3a64d1 /Source/cmIfCommand.cxx | |
parent | f1de724f41a516574f22d2b0e61ebf4b6d65c601 (diff) | |
parent | d6a03b475e023da9b7532a5b8735caec36b5de86 (diff) | |
download | CMake-e2d4bfef3fe24ba5846abbb2dc2c2e0ef58a21f5.zip CMake-e2d4bfef3fe24ba5846abbb2dc2c2e0ef58a21f5.tar.gz CMake-e2d4bfef3fe24ba5846abbb2dc2c2e0ef58a21f5.tar.bz2 |
Merge topic 'fix-CMP0054-elseif-warning'
d6a03b47 cmIfCommand: Issue CMP0054 warning with appropriate context. (#15802)
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r-- | Source/cmIfCommand.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index a03808f..5964ef1 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -107,7 +107,14 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmake::MessageType messType; - cmConditionEvaluator conditionEvaluator(mf); + cmListFileContext conditionContext = + cmConditionEvaluator::GetConditionContext( + &mf, this->Functions[c], + this->GetStartingContext().FilePath); + + cmConditionEvaluator conditionEvaluator( + mf, conditionContext, + mf.GetBacktrace(this->Functions[c])); bool isTrue = conditionEvaluator.IsTrue( expandedArguments, errorString, messType); @@ -196,7 +203,16 @@ bool cmIfCommand cmake::MessageType status; - cmConditionEvaluator conditionEvaluator(*(this->Makefile)); + cmListFileContext execContext = this->Makefile->GetExecutionContext(); + + cmCommandContext commandContext; + commandContext.Line = execContext.Line; + commandContext.Name = execContext.Name; + + cmConditionEvaluator conditionEvaluator( + *(this->Makefile), cmConditionEvaluator::GetConditionContext( + this->Makefile, commandContext, execContext.FilePath), + this->Makefile->GetBacktrace()); bool isTrue = conditionEvaluator.IsTrue( expandedArguments, errorString, status); |