diff options
author | Brad King <brad.king@kitware.com> | 2020-02-10 18:34:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-02-10 21:11:38 (GMT) |
commit | e75632843480aefc303303b85350ecddcc57cc5e (patch) | |
tree | e7927962f08b2817b93a6bb945a8238acd0bdfef /Source/cmLinkLineComputer.cxx | |
parent | 44b8937b7614560d9e88d25456c8394b4b209d51 (diff) | |
download | CMake-e75632843480aefc303303b85350ecddcc57cc5e.zip CMake-e75632843480aefc303303b85350ecddcc57cc5e.tar.gz CMake-e75632843480aefc303303b85350ecddcc57cc5e.tar.bz2 |
Propagate backtraces from LINK_LIBRARIES through to link line items
Since commit d4d0dd0f6a (cmLinkLineComputer: Add ComputeLinkLibs
overload with backtraces, 2019-09-13, v3.16.0-rc1~87^2~4), backtraces
have been collected by `ComputeLinkLibs` by looking back through the
link implementation libraries for one matching the text of the link line
item. This is slow in projects with long link lines.
Instead, teach `cmComputeLinkDepends` and `cmComputeLinkInformation` to
carry backtrace information explicitly along with the text of each item.
Fixes: #20322
Diffstat (limited to 'Source/cmLinkLineComputer.cxx')
-rw-r--r-- | Source/cmLinkLineComputer.cxx | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx index 0dc6236..3d516f8 100644 --- a/Source/cmLinkLineComputer.cxx +++ b/Source/cmLinkLineComputer.cxx @@ -9,7 +9,6 @@ #include "cmComputeLinkInformation.h" #include "cmGeneratorTarget.h" -#include "cmLinkItem.h" #include "cmListFileCache.h" #include "cmOutputConverter.h" #include "cmStateDirectory.h" @@ -79,27 +78,14 @@ void cmLinkLineComputer::ComputeLinkLibs( BT<std::string> linkLib; if (item.IsPath) { linkLib.Value += cli.GetLibLinkFileFlag(); - linkLib.Value += - this->ConvertToOutputFormat(this->ConvertToLinkReference(item.Value)); + linkLib.Value += this->ConvertToOutputFormat( + this->ConvertToLinkReference(item.Value.Value)); + linkLib.Backtrace = item.Value.Backtrace; } else { - linkLib.Value += item.Value; + linkLib = item.Value; } linkLib.Value += " "; - const cmLinkImplementation* linkImpl = - cli.GetTarget()->GetLinkImplementation(cli.GetConfig()); - - for (const cmLinkImplItem& iter : linkImpl->Libraries) { - if (iter.Target != nullptr && - iter.Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { - std::string libPath = iter.Target->GetLocation(cli.GetConfig()); - if (item.Value == libPath) { - linkLib.Backtrace = iter.Backtrace; - break; - } - } - } - linkLibraries.emplace_back(linkLib); } } |