From 52a8d19c9b67e5c902155f52fc7d145e091a5e7d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 18 May 2015 21:59:18 +0200 Subject: [PATCH] cmTarget: Store only cmListFileContext for CMP0023 handling. Only the top level execution context is shown, as appropriate, so store only that. --- Source/cmTarget.cxx | 27 ++++++++++++--------------- Source/cmTarget.h | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index d450a818e..ee5f02dc4 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1239,8 +1239,8 @@ bool cmTarget::PushTLLCommandTrace(TLLSignature signature) ret = false; } } - cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - this->TLLCommands.push_back(std::make_pair(signature, lfbt)); + cmListFileContext lfc = this->Makefile->GetExecutionContext(); + this->TLLCommands.push_back(std::make_pair(signature, lfc)); return ret; } @@ -1248,8 +1248,8 @@ bool cmTarget::PushTLLCommandTrace(TLLSignature signature) void cmTarget::GetTllSignatureTraces(std::ostringstream &s, TLLSignature sig) const { - std::vector sigs; - typedef std::vector > Container; + std::vector sigs; + typedef std::vector > Container; for(Container::const_iterator it = this->TLLCommands.begin(); it != this->TLLCommands.end(); ++it) { @@ -1258,6 +1258,7 @@ void cmTarget::GetTllSignatureTraces(std::ostringstream &s, sigs.push_back(it->second); } } + cmLocalGenerator* lg = this->GetMakefile()->GetLocalGenerator(); if (!sigs.empty()) { const char *sigString @@ -1265,20 +1266,16 @@ void cmTarget::GetTllSignatureTraces(std::ostringstream &s, : "plain"); s << "The uses of the " << sigString << " signature are here:\n"; UNORDERED_SET emitted; - for(std::vector::iterator it = sigs.begin(); + for(std::vector::iterator it = sigs.begin(); it != sigs.end(); ++it) { - it->MakeRelative(); - cmListFileBacktrace::const_iterator i = it->begin(); - if(i != it->end()) + cmListFileContext lfc = *it; + lfc.FilePath = lg->Convert(lfc.FilePath, cmLocalGenerator::HOME); + std::ostringstream line; + line << " * " << (lfc.Line? "": " in ") << lfc << std::endl; + if (emitted.insert(line.str()).second) { - cmListFileContext const& lfc = *i; - std::ostringstream line; - line << " * " << (lfc.Line? "": " in ") << lfc << std::endl; - if (emitted.insert(line.str()).second) - { - s << line.str(); - } + s << line.str(); } } } diff --git a/Source/cmTarget.h b/Source/cmTarget.h index a03241466..c5e9fc471 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -641,7 +641,7 @@ private: // directories. std::set SystemIncludeDirectories; - std::vector > TLLCommands; + std::vector > TLLCommands; #if defined(_WIN32) && !defined(__CYGWIN__) /**