diff options
author | Brad King <brad.king@kitware.com> | 2008-03-07 13:40:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-03-07 13:40:36 (GMT) |
commit | 680104a490250f7b56b67aa3cbb7c113d997e93c (patch) | |
tree | 52af6beb6a876f03a1205c050ad8295e338ca573 /Source/cmFunctionCommand.cxx | |
parent | 41a59e211ef6b0c9c839545661579934ce9415c1 (diff) | |
download | CMake-680104a490250f7b56b67aa3cbb7c113d997e93c.zip CMake-680104a490250f7b56b67aa3cbb7c113d997e93c.tar.gz CMake-680104a490250f7b56b67aa3cbb7c113d997e93c.tar.bz2 |
ENH: New format for warning and error messages
- Add cmMakefile methods IssueError and IssueWarning
- Maintain an explicit call stack in cmMakefile
- Include context/call-stack info in messages
- Nested errors now unwind the call stack
- Use new mechanism for policy warnings and errors
- Improve policy error message
- Include cmExecutionStatus pointer in call stack
so that errors deeper in the C++ stack under
a command invocation will become errors for the
command
Diffstat (limited to 'Source/cmFunctionCommand.cxx')
-rw-r--r-- | Source/cmFunctionCommand.cxx | 18 |
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()) |