summaryrefslogtreecommitdiffstats
path: root/Source/cmMacroCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-09-24 12:51:26 (GMT)
committerBrad King <brad.king@kitware.com>2008-09-24 12:51:26 (GMT)
commitdbd88e00c7c281991b28616fe8ac4cfe5f737ea3 (patch)
tree18a5edf4a3217db620a06806c4bbfd1420cb34c8 /Source/cmMacroCommand.cxx
parentd524f3675e455335eceb94eb7dce7fdb014abf58 (diff)
downloadCMake-dbd88e00c7c281991b28616fe8ac4cfe5f737ea3.zip
CMake-dbd88e00c7c281991b28616fe8ac4cfe5f737ea3.tar.gz
CMake-dbd88e00c7c281991b28616fe8ac4cfe5f737ea3.tar.bz2
ENH: Improve context for errors in macros
We now properly report the source location of command arguments inside macros instead of using the macro invocation site. No information is lost because full call-stack information is already reported.
Diffstat (limited to 'Source/cmMacroCommand.cxx')
-rw-r--r--Source/cmMacroCommand.cxx31
1 files changed, 2 insertions, 29 deletions
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 7c4a644..e7a27e5 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -129,13 +129,6 @@ bool cmMacroHelperCommand::InvokeInitialPass
newLFF.Name = this->Functions[c].Name;
newLFF.FilePath = this->Functions[c].FilePath;
newLFF.Line = this->Functions[c].Line;
- const char* def = this->Makefile->GetDefinition
- ("CMAKE_MACRO_REPORT_DEFINITION_LOCATION");
- bool macroReportLocation = false;
- if(def && !cmSystemTools::IsOff(def))
- {
- macroReportLocation = true;
- }
// for each argument of the current function
for (std::vector<cmListFileArgument>::const_iterator k =
@@ -212,28 +205,8 @@ bool cmMacroHelperCommand::InvokeInitialPass
arg.Value = tmps;
arg.Quoted = k->Quoted;
- if(macroReportLocation)
- {
- // Report the location of the argument where the macro was
- // defined.
- arg.FilePath = k->FilePath;
- arg.Line = k->Line;
- }
- else
- {
- // Report the location of the argument where the macro was
- // invoked.
- if (args.size())
- {
- arg.FilePath = args[0].FilePath;
- arg.Line = args[0].Line;
- }
- else
- {
- arg.FilePath = "Unknown";
- arg.Line = 0;
- }
- }
+ arg.FilePath = k->FilePath;
+ arg.Line = k->Line;
newLFF.Arguments.push_back(arg);
}
cmExecutionStatus status;