summaryrefslogtreecommitdiffstats
path: root/Source/cmFunctionCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmFunctionCommand.cxx')
-rw-r--r--Source/cmFunctionCommand.cxx18
1 files changed, 6 insertions, 12 deletions
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 7394709..8bad1a4 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -86,7 +86,7 @@ public:
bool cmFunctionHelperCommand::InvokeInitialPass
(const std::vector<cmListFileArgument>& args,
- cmExecutionStatus &)
+ cmExecutionStatus & inStatus)
{
// Expand the argument list to the function.
std::vector<std::string> expandedArgs;
@@ -157,18 +157,12 @@ bool cmFunctionHelperCommand::InvokeInitialPass
for(unsigned int c = 0; c < this->Functions.size(); ++c)
{
cmExecutionStatus status;
- if (!this->Makefile->ExecuteCommand(this->Functions[c],status))
+ if (!this->Makefile->ExecuteCommand(this->Functions[c],status) ||
+ status.GetNestedError())
{
- cmOStringStream error;
- error << "Error in cmake code at\n"
- << this->Functions[c].FilePath << ":"
- << this->Functions[c].Line << ":\n"
- << "A command failed during the invocation of function \""
- << this->Args[0].c_str() << "\".";
- cmSystemTools::Error(error.str().c_str());
-
- // pop scope on the makefile and return
- this->Makefile->PopScope();
+ // The error message should have already included the call stack
+ // so we do not need to report an error here.
+ inStatus.SetNestedError(true);
return false;
}
if (status.GetReturnInvoked())