diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-01-28 21:10:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-25 13:47:26 (GMT) |
commit | 14a8d61fd49a9b990cbef7e1495e4763f31c55f2 (patch) | |
tree | 5f680dfd5058708d30cea6442060a25c374849ff | |
parent | 2af853deb5225a9c8cb3d1e6311680c3fb7d86aa (diff) | |
download | CMake-14a8d61fd49a9b990cbef7e1495e4763f31c55f2.zip CMake-14a8d61fd49a9b990cbef7e1495e4763f31c55f2.tar.gz CMake-14a8d61fd49a9b990cbef7e1495e4763f31c55f2.tar.bz2 |
cmMakefile: Port nested error logic away from cmExecutionStatus
It is no longer needed.
-rw-r--r-- | Source/cmExecutionStatus.h | 4 | ||||
-rw-r--r-- | Source/cmFunctionCommand.cxx | 6 | ||||
-rw-r--r-- | Source/cmMacroCommand.cxx | 4 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 18 |
4 files changed, 16 insertions, 16 deletions
diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h index 508c6bd..8006514 100644 --- a/Source/cmExecutionStatus.h +++ b/Source/cmExecutionStatus.h @@ -38,16 +38,12 @@ public: this->ReturnInvoked = false; this->BreakInvoked = false; this->ContinueInvoked = false; - this->NestedError = false; } - void SetNestedError(bool val) { this->NestedError = val; } - bool GetNestedError() { return this->NestedError; } private: bool ReturnInvoked; bool BreakInvoked; bool ContinueInvoked; - bool NestedError; }; #endif diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 40c54db..f0e4854 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -76,7 +76,7 @@ public: }; bool cmFunctionHelperCommand::InvokeInitialPass( - const std::vector<cmListFileArgument>& args, cmExecutionStatus& inStatus) + const std::vector<cmListFileArgument>& args, cmExecutionStatus&) { // Expand the argument list to the function. std::vector<std::string> expandedArgs; @@ -129,11 +129,11 @@ bool cmFunctionHelperCommand::InvokeInitialPass( for (unsigned int c = 0; c < this->Functions.size(); ++c) { cmExecutionStatus status; if (!this->Makefile->ExecuteCommand(this->Functions[c], status) || - status.GetNestedError()) { + (cmSystemTools::GetErrorOccuredFlag() && + !cmSystemTools::GetFatalErrorOccured())) { // The error message should have already included the call stack // so we do not need to report an error here. functionScope.Quiet(); - inStatus.SetNestedError(true); return false; } if (status.GetReturnInvoked()) { diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index ee9dc8a..9d312ee 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -159,11 +159,11 @@ bool cmMacroHelperCommand::InvokeInitialPass( } cmExecutionStatus status; if (!this->Makefile->ExecuteCommand(newLFF, status) || - status.GetNestedError()) { + (cmSystemTools::GetErrorOccuredFlag() && + !cmSystemTools::GetFatalErrorOccured())) { // The error message should have already included the call stack // so we do not need to report an error here. macroScope.Quiet(); - inStatus.SetNestedError(true); return false; } if (status.GetReturnInvoked()) { diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index d299b8b..6c83b06 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -115,10 +115,6 @@ cmMakefile::~cmMakefile() void cmMakefile::IssueMessage(cmake::MessageType t, std::string const& text) const { - assert(!this->ExecutionStatusStack.empty()); - if ((t == cmake::FATAL_ERROR) || (t == cmake::INTERNAL_ERROR)) { - this->ExecutionStatusStack.back()->SetNestedError(true); - } this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace()); } @@ -279,11 +275,19 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, if (this->GetCMakeInstance()->GetTrace()) { this->PrintCommandTrace(lff); } - // Try invoking the command. + + bool hadPreviousNonFatalError = cmSystemTools::GetErrorOccuredFlag() && + !cmSystemTools::GetFatalErrorOccured(); + cmSystemTools::ResetErrorOccuredFlag(); + bool invokeSucceeded = pcmd->InvokeInitialPass(lff.Arguments, status); - bool hadNestedError = status.GetNestedError(); + bool hadNestedError = cmSystemTools::GetErrorOccuredFlag() && + !cmSystemTools::GetFatalErrorOccured(); + if (hadPreviousNonFatalError) { + cmSystemTools::SetErrorOccured(); + } if (!invokeSucceeded || hadNestedError) { - if (!hadNestedError) { + if (!hadNestedError && !cmSystemTools::GetFatalErrorOccured()) { // The command invocation requested that we report an error. this->IssueMessage(cmake::FATAL_ERROR, pcmd->GetError()); } |