summaryrefslogtreecommitdiffstats
path: root/Source/cmIfCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r--Source/cmIfCommand.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 20448c1..5964ef1 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -11,6 +11,7 @@
============================================================================*/
#include "cmIfCommand.h"
#include "cmStringCommand.h"
+#include "cmOutputConverter.h"
#include "cmConditionEvaluator.h"
@@ -106,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);
@@ -195,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);