diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-18 20:05:36 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-05-18 21:55:44 (GMT) |
commit | 65a42849639a3268f613795683d7c91a6ed8b661 (patch) | |
tree | 4f02bc99adcee8d7fbc4ebd7a00e0763b342e4cb | |
parent | 9645cba3bfc4bd583259130fd7e63da0c8bbecca (diff) | |
download | CMake-65a42849639a3268f613795683d7c91a6ed8b661.zip CMake-65a42849639a3268f613795683d7c91a6ed8b661.tar.gz CMake-65a42849639a3268f613795683d7c91a6ed8b661.tar.bz2 |
cmTarget: Store context in stack only if different.
The PushTLLCommandTrace method is called once per link item for a single
target_link_libraries command. Avoid storing copies of identical
execution contexts and rely on the uniqueness while printing output.
-rw-r--r-- | Source/cmTarget.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ee5f02d..aa556c8 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1240,7 +1240,10 @@ bool cmTarget::PushTLLCommandTrace(TLLSignature signature) } } cmListFileContext lfc = this->Makefile->GetExecutionContext(); - this->TLLCommands.push_back(std::make_pair(signature, lfc)); + if (this->TLLCommands.empty() || this->TLLCommands.back().second != lfc) + { + this->TLLCommands.push_back(std::make_pair(signature, lfc)); + } return ret; } @@ -1265,18 +1268,12 @@ void cmTarget::GetTllSignatureTraces(std::ostringstream &s, = (sig == cmTarget::KeywordTLLSignature ? "keyword" : "plain"); s << "The uses of the " << sigString << " signature are here:\n"; - UNORDERED_SET<std::string> emitted; for(std::vector<cmListFileContext>::iterator it = sigs.begin(); it != sigs.end(); ++it) { 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) - { - s << line.str(); - } + s << " * " << (lfc.Line ? "" : " in ") << lfc << std::endl; } } } |