summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-03-13 17:48:57 (GMT)
committerBrad King <brad.king@kitware.com>2008-03-13 17:48:57 (GMT)
commitf7f03347a64c629149803594b92c2b4b40e783fd (patch)
tree5035b672977616bb63be8f10fc2605e7dac83741 /Source/cmTarget.cxx
parent73df9a5cd4f6ac66ea71c073ce3e01d68c512074 (diff)
downloadCMake-f7f03347a64c629149803594b92c2b4b40e783fd.zip
CMake-f7f03347a64c629149803594b92c2b4b40e783fd.tar.gz
CMake-f7f03347a64c629149803594b92c2b4b40e783fd.tar.bz2
ENH: Improve new error/warning message generation
- Add cmListFileBacktrace to record stack traces - Move main IssueMessage method to the cmake class instance (make the backtrace an explicit argument) - Change cmMakefile::IssueMessage to construct a backtrace and call the cmake instance version - Record a backtrace at the point a target is created (useful later for messages issued by generators)
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 2d650ac..429c5f9 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -21,6 +21,7 @@
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
#include "cmComputeLinkInformation.h"
+#include "cmListFileCache.h"
#include <map>
#include <set>
#include <queue>
@@ -43,6 +44,9 @@ public:
typedef cmTarget::SourceFileFlags SourceFileFlags;
std::map<cmSourceFile const*, SourceFileFlags> SourceFlagsMap;
bool SourceFileFlagsConstructed;
+
+ // The backtrace when the target was created.
+ cmListFileBacktrace Backtrace;
};
//----------------------------------------------------------------------------
@@ -719,6 +723,15 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->SetPropertyDefault(property.c_str(), 0);
}
}
+
+ // Save the backtrace of target construction.
+ this->Makefile->GetBacktrace(this->Internal->Backtrace);
+}
+
+//----------------------------------------------------------------------------
+cmListFileBacktrace const& cmTarget::GetBacktrace() const
+{
+ return this->Internal->Backtrace;
}
//----------------------------------------------------------------------------