From e6c2e3ee1bdca35d5d1125a863a94e948ae49575 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Mon, 2 Jul 2018 10:37:20 +0530 Subject: [PATCH] Update hip-targets.cmake for hip::host & hip::device [ROCm/clr commit: 1978cea4b7db775dfc11ad9d7aaa923a110a4faf] --- .../clr/hipamd/packaging/hip-targets.cmake | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/packaging/hip-targets.cmake b/projects/clr/hipamd/packaging/hip-targets.cmake index 65370eec9e..5aff2ca1ed 100644 --- a/projects/clr/hipamd/packaging/hip-targets.cmake +++ b/projects/clr/hipamd/packaging/hip-targets.cmake @@ -16,7 +16,7 @@ set(CMAKE_IMPORT_FILE_VERSION 1) set(_targetsDefined) set(_targetsNotDefined) set(_expectedTargets) -foreach(_expectedTarget hip::hip_hcc_static hip::hip_hcc hip::hip_device) +foreach(_expectedTarget hip::hip_hcc_static hip::hip_hcc hip::hip_device hip::host hip::device) list(APPEND _expectedTargets ${_expectedTarget}) if(NOT TARGET ${_expectedTarget}) list(APPEND _targetsNotDefined ${_expectedTarget}) @@ -65,6 +65,24 @@ set_target_properties(hip::hip_device PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;/opt/rocm/hsa/include" ) +# Create imported target hip::host +add_library(hip::host INTERFACE IMPORTED) + +set_target_properties(hip::host PROPERTIES + INTERFACE_LINK_LIBRARIES "hip::hip_hcc" +) + +# Create imported target hip::device +add_library(hip::device INTERFACE IMPORTED) + +set_target_properties(hip::device PROPERTIES + INTERFACE_LINK_LIBRARIES "hip::host;hip::hip_device;hcc::hccrt;hcc::hc_am" +) + +if(CMAKE_VERSION VERSION_LESS 3.0.0) + message(FATAL_ERROR "This file relies on consumers using CMake 3.0.0 or greater.") +endif() + # Load information for each installed configuration. get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) file(GLOB CONFIG_FILES "${_DIR}/hip-targets-*.cmake")