[Cmake-commits] [cmake-commits] king committed cmMacroCommand.cxx 1.36 1.37

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Sep 24 08:51:29 EDT 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv28964/Source

Modified Files:
	cmMacroCommand.cxx 
Log Message:
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.


Index: cmMacroCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMacroCommand.cxx,v
retrieving revision 1.36
retrieving revision 1.37
diff -C 2 -d -r1.36 -r1.37
*** cmMacroCommand.cxx	7 Mar 2008 13:40:36 -0000	1.36
--- cmMacroCommand.cxx	24 Sep 2008 12:51:26 -0000	1.37
***************
*** 130,140 ****
      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
--- 130,133 ----
***************
*** 213,238 ****
        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;
!           }
!         }
        newLFF.Arguments.push_back(arg);
        }
--- 206,211 ----
        arg.Value = tmps;
        arg.Quoted = k->Quoted;
!       arg.FilePath = k->FilePath;
!       arg.Line = k->Line;
        newLFF.Arguments.push_back(arg);
        }



More information about the Cmake-commits mailing list