diff options
author | Justin Goshi <jgoshi@microsoft.com> | 2019-09-11 17:31:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-09-18 13:58:41 (GMT) |
commit | 0c6468178a76b6a2a11791b010ab01c97855affa (patch) | |
tree | 99e5d50d94429960ea2f1ede3f91db717d47950f | |
parent | a209b31d0d088de40ba5bebdc6c9650f0583b2a6 (diff) | |
download | CMake-0c6468178a76b6a2a11791b010ab01c97855affa.zip CMake-0c6468178a76b6a2a11791b010ab01c97855affa.tar.gz CMake-0c6468178a76b6a2a11791b010ab01c97855affa.tar.bz2 |
cmComputeLinkInformation: Add GetDirectoriesWithBacktraces
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 22 | ||||
-rw-r--r-- | Source/cmComputeLinkInformation.h | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index ed0bb85..6ee6455 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -431,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) diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index ee36a71..71af43f 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -48,6 +48,7 @@ public: void AppendValues(std::string& result, std::vector<BT<std::string>>& values); ItemVector const& GetItems() const; std::vector<std::string> const& GetDirectories() const; + std::vector<BT<std::string>> GetDirectoriesWithBacktraces(); std::vector<std::string> const& GetDepends() const; std::vector<std::string> const& GetFrameworkPaths() const; std::string GetLinkLanguage() const { return this->LinkLanguage; } |