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 /Source/cmComputeLinkInformation.cxx | |
parent | a209b31d0d088de40ba5bebdc6c9650f0583b2a6 (diff) | |
download | CMake-0c6468178a76b6a2a11791b010ab01c97855affa.zip CMake-0c6468178a76b6a2a11791b010ab01c97855affa.tar.gz CMake-0c6468178a76b6a2a11791b010ab01c97855affa.tar.bz2 |
cmComputeLinkInformation: Add GetDirectoriesWithBacktraces
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 22 |
1 files changed, 22 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) |