diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-09-02 18:53:41 (GMT) |
---|---|---|
committer | Zack Galbreath <zack.galbreath@kitware.com> | 2021-06-07 19:25:33 (GMT) |
commit | 947dbed0aa502c70a9e165757450bd8409036980 (patch) | |
tree | 0a45b31986184368c7ad6df72d9f9186c7a24b4c /Source/cmComputeLinkDepends.cxx | |
parent | b50bfc89131e55685aa41146254b37d26049b4d5 (diff) | |
download | CMake-947dbed0aa502c70a9e165757450bd8409036980.zip CMake-947dbed0aa502c70a9e165757450bd8409036980.tar.gz CMake-947dbed0aa502c70a9e165757450bd8409036980.tar.bz2 |
HIP: Automatically inject the `hip::device` runtime target
Any target that might need to link to hip code needs the `hip::device`
target
Diffstat (limited to 'Source/cmComputeLinkDepends.cxx')
-rw-r--r-- | Source/cmComputeLinkDepends.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 4a6518fd..0b27e34 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -7,6 +7,7 @@ #include <cstdio> #include <iterator> #include <sstream> +#include <unordered_map> #include <utility> #include <cm/memory> @@ -371,6 +372,12 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry qe) // This target provides its own link interface information. this->AddLinkEntries(depender_index, iface->Libraries); this->AddLinkObjects(iface->Objects); + for (auto const& language : iface->Languages) { + auto runtimeEntries = iface->LanguageRuntimeLibraries.find(language); + if (runtimeEntries != iface->LanguageRuntimeLibraries.end()) { + this->AddLinkEntries(depender_index, runtimeEntries->second); + } + } if (isIface) { return; @@ -516,6 +523,13 @@ void cmComputeLinkDepends::AddDirectLinkEntries() this->Target->GetLinkImplementation(this->Config); this->AddLinkEntries(-1, impl->Libraries); this->AddLinkObjects(impl->Objects); + + for (auto const& language : impl->Languages) { + auto runtimeEntries = impl->LanguageRuntimeLibraries.find(language); + if (runtimeEntries != impl->LanguageRuntimeLibraries.end()) { + this->AddLinkEntries(-1, runtimeEntries->second); + } + } for (cmLinkItem const& wi : impl->WrongConfigLibraries) { this->CheckWrongConfigItem(wi); } |