Merge pull request #633 from aaronenyeshi/hip-clang-remove-am

Remove few hcc specific cmake for hip-clang

[ROCm/hip commit: 5cb819b34e]
This commit is contained in:
Maneesh Gupta
2018-09-13 10:20:12 +05:30
committed by GitHub
4 changed files with 27 additions and 3 deletions
+4 -2
View File
@@ -217,9 +217,11 @@ if(HIP_PLATFORM STREQUAL "hcc")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L/opt/rocm/profiler/CXLActivityLogger/bin/x86_64 -lCXLActivityLogger")
endif()
add_library(hip_hcc SHARED ${SOURCE_FILES_RUNTIME})
target_link_libraries(hip_hcc PRIVATE hc_am)
add_library(hip_hcc_static STATIC ${SOURCE_FILES_RUNTIME})
target_link_libraries(hip_hcc_static PRIVATE hc_am)
if(HIP_COMPILER STREQUAL "hcc")
target_link_libraries(hip_hcc PRIVATE hc_am)
target_link_libraries(hip_hcc_static PRIVATE hc_am)
endif()
add_library(hip_device STATIC ${SOURCE_FILES_DEVICE})
string(REPLACE " " ";" HCC_CXX_FLAGS_LIST ${HCC_CXX_FLAGS})
+3 -1
View File
@@ -48,7 +48,9 @@ set_and_check( hip_BIN_INSTALL_DIR "@PACKAGE_BIN_INSTALL_DIR@" )
set_and_check(hip_HIPCC_EXECUTABLE "${hip_BIN_INSTALL_DIR}/hipcc")
set_and_check(hip_HIPCONFIG_EXECUTABLE "${hip_BIN_INSTALL_DIR}/hipconfig")
find_dependency(hcc)
if(HIP_COMPILER STREQUAL "hcc")
find_dependency(hcc)
endif()
include( "${CMAKE_CURRENT_LIST_DIR}/hip-targets.cmake" )
set( hip_LIBRARIES hip::host hip::device)
@@ -7,22 +7,36 @@ set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "hip::hip_hcc_static" for configuration "Release"
set_property(TARGET hip::hip_hcc_static APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
if(HIP_COMPILER STREQUAL "clang")
set_target_properties(hip::hip_hcc_static PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
IMPORTED_LOCATION_RELEASE "/opt/rocm/hip/lib/libhip_hcc_static.a"
)
else()
set_target_properties(hip::hip_hcc_static PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "hc_am"
IMPORTED_LOCATION_RELEASE "/opt/rocm/hip/lib/libhip_hcc_static.a"
)
endif()
list(APPEND _IMPORT_CHECK_TARGETS hip::hip_hcc_static )
list(APPEND _IMPORT_CHECK_FILES_FOR_hip::hip_hcc_static "/opt/rocm/hip/lib/libhip_hcc_static.a" )
# Import target "hip::hip_hcc" for configuration "Release"
set_property(TARGET hip::hip_hcc APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
if(HIP_COMPILER STREQUAL "clang")
set_target_properties(hip::hip_hcc PROPERTIES
IMPORTED_LOCATION_RELEASE "/opt/rocm/hip/lib/libhip_hcc.so"
IMPORTED_SONAME_RELEASE "libhip_hcc.so"
)
else()
set_target_properties(hip::hip_hcc PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "hcc::hccrt;hcc::hc_am"
IMPORTED_LOCATION_RELEASE "/opt/rocm/hip/lib/libhip_hcc.so"
IMPORTED_SONAME_RELEASE "libhip_hcc.so"
)
endif()
list(APPEND _IMPORT_CHECK_TARGETS hip::hip_hcc )
list(APPEND _IMPORT_CHECK_FILES_FOR_hip::hip_hcc "/opt/rocm/hip/lib/libhip_hcc.so" )
+6
View File
@@ -75,9 +75,15 @@ set_target_properties(hip::host PROPERTIES
# Create imported target hip::device
add_library(hip::device INTERFACE IMPORTED)
if(HIP_COMPILER STREQUAL "clang")
set_target_properties(hip::device PROPERTIES
INTERFACE_LINK_LIBRARIES "hip::host;hip::hip_device"
)
else()
set_target_properties(hip::device PROPERTIES
INTERFACE_LINK_LIBRARIES "hip::host;hip::hip_device;hcc::hccrt;hcc::hc_am"
)
endif()
if(CMAKE_VERSION VERSION_LESS 3.0.0)
message(FATAL_ERROR "This file relies on consumers using CMake 3.0.0 or greater.")