diff options
Diffstat (limited to 'Source/cmWhileCommand.cxx')
-rw-r--r-- | Source/cmWhileCommand.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 0d8e894..876ce20 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -17,6 +17,7 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmSystemTools.h" +#include "cmake.h" class cmWhileFunctionBlocker : public cmFunctionBlocker { @@ -66,14 +67,10 @@ bool cmWhileFunctionBlocker::Replay(std::vector<cmListFileFunction> functions, mf.ExpandArguments(this->Args, expandedArguments); MessageType messageType; - cmListFileContext execContext = this->GetStartingContext(); - - cmCommandContext commandContext; - commandContext.Line = execContext.Line; - commandContext.Name = execContext.Name; - + cmListFileBacktrace whileBT = + mf.GetBacktrace().Push(this->GetStartingContext()); cmConditionEvaluator conditionEvaluator(mf, this->GetStartingContext(), - mf.GetBacktrace(commandContext)); + whileBT); bool isTrue = conditionEvaluator.IsTrue(expandedArguments, errorString, messageType); @@ -90,7 +87,7 @@ bool cmWhileFunctionBlocker::Replay(std::vector<cmListFileFunction> functions, err += "("; err += errorString; err += ")."; - mf.IssueMessage(messageType, err); + mf.GetCMakeInstance()->IssueMessage(messageType, err, whileBT); if (messageType == MessageType::FATAL_ERROR) { cmSystemTools::SetFatalErrorOccured(); return true; |