diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2014-03-12 17:59:42 -0400 |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2014-06-05 12:44:19 -0400 |
commit | 2a1b2d848693a3860f8e5f179b6c97f8c56abede (patch) | |
tree | 7987c9ba6b2be8fa15a6e7c9fe820ce512554f7e /Source/cmListFileCache.cxx | |
parent | a08292059eba4fdded6643b225640ebf559b2dac (diff) | |
download | cmake-2a1b2d848693a3860f8e5f179b6c97f8c56abede.tar.gz |
backtrace: Convert to local paths in IssueMessage
This is the only place we care show the FilePath to the user, so defer
the expensive relative path calculation until here.
Diffstat (limited to 'Source/cmListFileCache.cxx')
-rw-r--r-- | Source/cmListFileCache.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 34781d32c6..705666d81c 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -12,6 +12,7 @@ #include "cmListFileCache.h" #include "cmListFileLexer.h" +#include "cmLocalGenerator.h" #include "cmSystemTools.h" #include "cmMakefile.h" #include "cmVersion.h" @@ -408,6 +409,23 @@ bool cmListFileParser::AddArgument(cmListFileLexer_Token* token, } //---------------------------------------------------------------------------- +void cmListFileBacktrace::MakeRelative() +{ + if (this->Relative) + { + return; + } + for (cmListFileBacktrace::iterator i = this->begin(); + i != this->end(); ++i) + { + i->FilePath = this->LocalGenerator->Convert(i->FilePath, + cmLocalGenerator::HOME); + } + this->Relative = true; +} + + +//---------------------------------------------------------------------------- std::ostream& operator<<(std::ostream& os, cmListFileContext const& lfc) { os << lfc.FilePath; |