|
@@ -117,6 +117,11 @@ cmMakefile::~cmMakefile()
|
|
|
void cmMakefile::IssueMessage(cmake::MessageType t,
|
|
|
std::string const& text) const
|
|
|
{
|
|
|
+ if (!this->ExecutionStatusStack.empty()) {
|
|
|
+ if ((t == cmake::FATAL_ERROR) || (t == cmake::INTERNAL_ERROR)) {
|
|
|
+ this->ExecutionStatusStack.back()->SetNestedError(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace());
|
|
|
}
|
|
|
|
|
@@ -277,19 +282,11 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
|
|
|
if (this->GetCMakeInstance()->GetTrace()) {
|
|
|
this->PrintCommandTrace(lff);
|
|
|
}
|
|
|
-
|
|
|
- bool hadPreviousNonFatalError = cmSystemTools::GetErrorOccuredFlag() &&
|
|
|
- !cmSystemTools::GetFatalErrorOccured();
|
|
|
- cmSystemTools::ResetErrorOccuredFlag();
|
|
|
-
|
|
|
+ // Try invoking the command.
|
|
|
bool invokeSucceeded = pcmd->InvokeInitialPass(lff.Arguments, status);
|
|
|
- bool hadNestedError = cmSystemTools::GetErrorOccuredFlag() &&
|
|
|
- !cmSystemTools::GetFatalErrorOccured();
|
|
|
- if (hadPreviousNonFatalError) {
|
|
|
- cmSystemTools::SetErrorOccured();
|
|
|
- }
|
|
|
+ bool hadNestedError = status.GetNestedError();
|
|
|
if (!invokeSucceeded || hadNestedError) {
|
|
|
- if (!hadNestedError && !cmSystemTools::GetFatalErrorOccured()) {
|
|
|
+ if (!hadNestedError) {
|
|
|
// The command invocation requested that we report an error.
|
|
|
this->IssueMessage(cmake::FATAL_ERROR, pcmd->GetError());
|
|
|
}
|