Commit 84c0fdb1 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'clean-up-cmMakefile-IssueMessage'

5bbcf758 cmIfCommand: Don't rely on NestedError logic to issue messages
262ce91e cmMakefile: Extract invoke result variables
parents 2701b519 5bbcf758
......@@ -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);
}
......
......@@ -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());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment