summaryrefslogtreecommitdiff
path: root/Modules/CMakeHIPInformation.cmake
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2020-09-02 14:53:41 -0400
committerZack Galbreath <zack.galbreath@kitware.com>2021-06-07 19:25:33 +0000
commit947dbed0aa502c70a9e165757450bd8409036980 (patch)
tree0a45b31986184368c7ad6df72d9f9186c7a24b4c /Modules/CMakeHIPInformation.cmake
parentb50bfc89131e55685aa41146254b37d26049b4d5 (diff)
downloadcmake-947dbed0aa502c70a9e165757450bd8409036980.tar.gz
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 'Modules/CMakeHIPInformation.cmake')
-rw-r--r--Modules/CMakeHIPInformation.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/CMakeHIPInformation.cmake b/Modules/CMakeHIPInformation.cmake
index df1d98ae41..ec37e1c91a 100644
--- a/Modules/CMakeHIPInformation.cmake
+++ b/Modules/CMakeHIPInformation.cmake
@@ -130,3 +130,10 @@ if(NOT CMAKE_HIP_LINK_EXECUTABLE)
endif()
set(CMAKE_HIP_INFORMATION_LOADED 1)
+
+# Load the file and find the relevant HIP runtime.
+# This file will only exist after all compiler detection has finished
+include(${CMAKE_PLATFORM_INFO_DIR}/CMakeHIPRuntime.cmake OPTIONAL)
+if(COMMAND _CMAKE_FIND_HIP_RUNTIME)
+ _CMAKE_FIND_HIP_RUNTIME()
+endif()