浏览代码

cmComputeLinkInformation: Add AppendValues with backtraces

Justin Goshi 6 年之前
父节点
当前提交
a209b31d0d
共有 2 个文件被更改,包括 16 次插入0 次删除
  1. 13 0
      Source/cmComputeLinkInformation.cxx
  2. 3 0
      Source/cmComputeLinkInformation.h

+ 13 - 0
Source/cmComputeLinkInformation.cxx

@@ -6,6 +6,7 @@
 #include "cmComputeLinkDepends.h"
 #include "cmGeneratorTarget.h"
 #include "cmGlobalGenerator.h"
+#include "cmListFileCache.h"
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmMessageType.h"
@@ -406,6 +407,18 @@ cmComputeLinkInformation::~cmComputeLinkInformation()
   delete this->OrderDependentRPath;
 }
 
+void cmComputeLinkInformation::AppendValues(
+  std::string& result, std::vector<BT<std::string>>& values)
+{
+  for (BT<std::string>& p : values) {
+    if (result.empty()) {
+      result.append(" ");
+    }
+
+    result.append(p.Value);
+  }
+}
+
 cmComputeLinkInformation::ItemVector const&
 cmComputeLinkInformation::GetItems() const
 {

+ 3 - 0
Source/cmComputeLinkInformation.h

@@ -17,6 +17,8 @@ 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.
@@ -43,6 +45,7 @@ public:
     cmGeneratorTarget const* Target = nullptr;
   };
   using ItemVector = std::vector<Item>;
+  void AppendValues(std::string& result, std::vector<BT<std::string>>& values);
   ItemVector const& GetItems() const;
   std::vector<std::string> const& GetDirectories() const;
   std::vector<std::string> const& GetDepends() const;