Merge topic 'clean-up-cmMakefile-IssueMessage'

5bbcf758 cmIfCommand: Don't rely on NestedError logic to issue messages
262ce91e cmMakefile: Extract invoke result variables
This commit is contained in:
Brad King 2016-06-16 09:46:47 -04:00 committed by CMake Topic Stage
commit 84c0fdb192
2 changed files with 7 additions and 6 deletions

View File

@ -185,12 +185,12 @@ bool cmIfCommand::InvokeInitialPass(
conditionEvaluator.IsTrue(expandedArguments, errorString, status); conditionEvaluator.IsTrue(expandedArguments, errorString, status);
if (!errorString.empty()) { if (!errorString.empty()) {
std::string err = cmIfCommandError(expandedArguments); std::string err = "if " + cmIfCommandError(expandedArguments);
err += errorString; err += errorString;
if (status == cmake::FATAL_ERROR) { if (status == cmake::FATAL_ERROR) {
this->SetError(err); this->Makefile->IssueMessage(cmake::FATAL_ERROR, err);
cmSystemTools::SetFatalErrorOccured(); cmSystemTools::SetFatalErrorOccured();
return false; return true;
} else { } else {
this->Makefile->IssueMessage(status, err); this->Makefile->IssueMessage(status, err);
} }

View File

@ -254,9 +254,10 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
this->PrintCommandTrace(lff); this->PrintCommandTrace(lff);
} }
// Try invoking the command. // Try invoking the command.
if (!pcmd->InvokeInitialPass(lff.Arguments, status) || bool invokeSucceeded = pcmd->InvokeInitialPass(lff.Arguments, status);
status.GetNestedError()) { bool hadNestedError = status.GetNestedError();
if (!status.GetNestedError()) { if (!invokeSucceeded || hadNestedError) {
if (!hadNestedError) {
// The command invocation requested that we report an error. // The command invocation requested that we report an error.
this->IssueMessage(cmake::FATAL_ERROR, pcmd->GetError()); this->IssueMessage(cmake::FATAL_ERROR, pcmd->GetError());
} }