diff options
author | Brad King <brad.king@kitware.com> | 2018-10-17 14:25:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-10-18 12:10:55 (GMT) |
commit | a6e02f881dc5e74d79201f761fb28c99a9e7d2af (patch) | |
tree | a71f752171ef570eff69ec6cc545671ba25a9db0 /Source/cmTarget.cxx | |
parent | a093b1a4f3c8c40c55c50ad8e701ceb599961140 (diff) | |
download | CMake-a6e02f881dc5e74d79201f761fb28c99a9e7d2af.zip CMake-a6e02f881dc5e74d79201f761fb28c99a9e7d2af.tar.gz CMake-a6e02f881dc5e74d79201f761fb28c99a9e7d2af.tar.bz2 |
add_dependencies: Track backtraces internally
Record backtraces for "utility" dependencies created by
`add_dependencies` calls.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index f0d6519..1458f01 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -486,24 +486,10 @@ cmGlobalGenerator* cmTarget::GetGlobalGenerator() const return this->GetMakefile()->GetGlobalGenerator(); } -void cmTarget::AddUtility(const std::string& u, cmMakefile* makefile) +void cmTarget::AddUtility(std::string const& u, cmMakefile* mf) { - if (this->Utilities.insert(u).second && makefile) { - this->UtilityBacktraces.insert( - std::make_pair(u, makefile->GetBacktrace())); - } -} - -cmListFileBacktrace const* cmTarget::GetUtilityBacktrace( - const std::string& u) const -{ - std::map<std::string, cmListFileBacktrace>::const_iterator i = - this->UtilityBacktraces.find(u); - if (i == this->UtilityBacktraces.end()) { - return nullptr; - } - - return &i->second; + BT<std::string> util(u, mf ? mf->GetBacktrace() : cmListFileBacktrace()); + this->Utilities.insert(util); } cmListFileBacktrace const& cmTarget::GetBacktrace() const |