From 262ce91e8ac3c6fc9b09605e652028db7229b9b8 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 28 Jan 2016 22:10:28 +0100 Subject: [PATCH 1/2] cmMakefile: Extract invoke result variables Make it more clear what is happening here. --- Source/cmMakefile.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c9192fdeb..bfcd7dbc0 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -254,9 +254,10 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, this->PrintCommandTrace(lff); } // Try invoking the command. - if (!pcmd->InvokeInitialPass(lff.Arguments, status) || - status.GetNestedError()) { - if (!status.GetNestedError()) { + bool invokeSucceeded = pcmd->InvokeInitialPass(lff.Arguments, status); + bool hadNestedError = status.GetNestedError(); + if (!invokeSucceeded || hadNestedError) { + if (!hadNestedError) { // The command invocation requested that we report an error. this->IssueMessage(cmake::FATAL_ERROR, pcmd->GetError()); } From 5bbcf758a1a0c52836d313156788a10a232f1f9f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 28 Jan 2016 22:10:29 +0100 Subject: [PATCH 2/2] cmIfCommand: Don't rely on NestedError logic to issue messages --- Source/cmIfCommand.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 45395d1ea..cb5ba76b1 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -185,12 +185,12 @@ bool cmIfCommand::InvokeInitialPass( conditionEvaluator.IsTrue(expandedArguments, errorString, status); if (!errorString.empty()) { - std::string err = cmIfCommandError(expandedArguments); + std::string err = "if " + cmIfCommandError(expandedArguments); err += errorString; if (status == cmake::FATAL_ERROR) { - this->SetError(err); + this->Makefile->IssueMessage(cmake::FATAL_ERROR, err); cmSystemTools::SetFatalErrorOccured(); - return false; + return true; } else { this->Makefile->IssueMessage(status, err); }