diff options
author | Brad King <brad.king@kitware.com> | 2019-09-20 14:21:47 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-09-20 14:22:01 (GMT) |
commit | 4ade1b00c5b2ca2e3c5ce5f5bcd7dd0a61ef7a2e (patch) | |
tree | a91134d134b2e95e3650e756613a954285cdaabd /Source/cmComputeLinkInformation.cxx | |
parent | 3c060ae6ca01464d507d6c7b6cef38639084418f (diff) | |
parent | 4d6334824d81086af205fe06b6fc4c4fda5224b4 (diff) | |
download | CMake-4ade1b00c5b2ca2e3c5ce5f5bcd7dd0a61ef7a2e.zip CMake-4ade1b00c5b2ca2e3c5ce5f5bcd7dd0a61ef7a2e.tar.gz CMake-4ade1b00c5b2ca2e3c5ce5f5bcd7dd0a61ef7a2e.tar.bz2 |
Merge topic 'fileapiLinkPathAndLinkDirBacktraces'
4d6334824d fileapi: add backtraces for LINK_PATH and LINK_DIRECTORIES
5bd65dff7a cmLocalGenerator: Add OutputLinkLibraries overload with backtraces
5d39e792ae cmGeneratorTarget: Store backtrace for target LINK_DIRECTORIES property
7da17ef797 cmLinkLineComputer: Add ComputeLinkLibraries overload with backtraces
d4d0dd0f6a cmLinkLineComputer: Add ComputeLinkLibs overload with backtraces
0ac9dcb807 cmLinkLineComputer: Add ComputeLinkPath overload with backtraces
0c6468178a cmComputeLinkInformation: Add GetDirectoriesWithBacktraces
a209b31d0d cmComputeLinkInformation: Add AppendValues with backtraces
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3805
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 09dbbb1..832f38e 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/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 { @@ -418,6 +431,28 @@ std::vector<std::string> const& cmComputeLinkInformation::GetDirectories() return this->OrderLinkerSearchPath->GetOrderedDirectories(); } +std::vector<BT<std::string>> +cmComputeLinkInformation::GetDirectoriesWithBacktraces() +{ + std::vector<BT<std::string>> directoriesWithBacktraces; + + std::vector<BT<std::string>> targetLinkDirectores = + this->Target->GetLinkDirectories(this->Config, this->LinkLanguage); + + const std::vector<std::string>& orderedDirectories = this->GetDirectories(); + for (const std::string& dir : orderedDirectories) { + auto result = + std::find(targetLinkDirectores.begin(), targetLinkDirectores.end(), dir); + if (result != targetLinkDirectores.end()) { + directoriesWithBacktraces.emplace_back(std::move(*result)); + } else { + directoriesWithBacktraces.emplace_back(dir); + } + } + + return directoriesWithBacktraces; +} + std::string cmComputeLinkInformation::GetRPathLinkString() const { // If there is no separate linker runtime search flag (-rpath-link) |