summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-02-10 18:34:33 (GMT)
committerBrad King <brad.king@kitware.com>2020-02-10 21:11:38 (GMT)
commite75632843480aefc303303b85350ecddcc57cc5e (patch)
treee7927962f08b2817b93a6bb945a8238acd0bdfef /Source/cmComputeLinkInformation.h
parent44b8937b7614560d9e88d25456c8394b4b209d51 (diff)
downloadCMake-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/cmComputeLinkInformation.h')
-rw-r--r--Source/cmComputeLinkInformation.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index 92ab83b..ee74ccd 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -13,13 +13,13 @@
#include "cmsys/RegularExpression.hxx"
+#include "cmListFileCache.h"
+
class cmGeneratorTarget;
class cmGlobalGenerator;
class cmMakefile;
class cmOrderDirectories;
class cmake;
-template <typename T>
-class BT;
/** \class cmComputeLinkInformation
* \brief Compute link information for a target in one configuration.
@@ -35,13 +35,13 @@ public:
struct Item
{
Item() = default;
- Item(std::string v, bool p, cmGeneratorTarget const* target = nullptr)
+ Item(BT<std::string> v, bool p, cmGeneratorTarget const* target = nullptr)
: Value(std::move(v))
, IsPath(p)
, Target(target)
{
}
- std::string Value;
+ BT<std::string> Value;
bool IsPath = true;
cmGeneratorTarget const* Target = nullptr;
};
@@ -74,8 +74,9 @@ public:
const cmGeneratorTarget* GetTarget() { return this->Target; }
private:
- void AddItem(std::string const& item, const cmGeneratorTarget* tgt);
- void AddSharedDepItem(std::string const& item, cmGeneratorTarget const* tgt);
+ void AddItem(BT<std::string> const& item, const cmGeneratorTarget* tgt);
+ void AddSharedDepItem(BT<std::string> const& item,
+ cmGeneratorTarget const* tgt);
// Output information.
ItemVector Items;
@@ -146,10 +147,11 @@ private:
std::string NoCaseExpression(const char* str);
// Handling of link items.
- void AddTargetItem(std::string const& item, const cmGeneratorTarget* target);
- void AddFullItem(std::string const& item);
+ void AddTargetItem(BT<std::string> const& item,
+ const cmGeneratorTarget* target);
+ void AddFullItem(BT<std::string> const& item);
bool CheckImplicitDirItem(std::string const& item);
- void AddUserItem(std::string const& item, bool pathNotKnown);
+ void AddUserItem(BT<std::string> const& item, bool pathNotKnown);
void AddDirectoryItem(std::string const& item);
void AddFrameworkItem(std::string const& item);
void DropDirectoryItem(std::string const& item);