SWDEV-415414 - Corrected the IMPORT_PREFIX path in FindHIP.cmake (#3308)

The IMPORT_PREFIX path in FindHIP.cmake was generated as <Install_Prefix>/hip rather than <Install_Prefix> in Linux OS
With file reorg backward compatibility turned off, the path <Install_Prefix>/hip is no more valid
Corrected the same, so that IMPORT_PREFIX will always be generated as <Install_Prefix>

Change-Id: I60b8ee5085c1b4eda0a8494d7f8e1e55accd2f82


[ROCm/hip commit: 9cb358b157]
This commit is contained in:
ROCm CI Service Account
2023-08-31 22:43:19 +05:30
committed by GitHub
parent 7bb16a3d04
commit 0f2c452432
+10 -2
View File
@@ -81,8 +81,16 @@ elseif (HIP_CXX_COMPILER MATCHES ".*clang\\+\\+")
set(HIP_CLANG_PATH "${_HIP_CLANG_BIN_PATH}")
endif()
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../" REALPATH)
if(WIN32)
# In windows FindHIP.cmake is installed in <Install_Prefix>/cmake
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../" REALPATH)
else()
# In Linux FindHIP.cmake is installed in <Install_Prefix>/lib/cmake/hip
# RealPath: <Install_Prefix>/lib/cmake/hip/FindHIP.cmake
# Go 4 level up to get IMPORT PREFIX as <Install_Prefix>
get_filename_component(_FILE_PATH "${CMAKE_CURRENT_LIST_FILE}" REALPATH)
get_filename_component(_IMPORT_PREFIX "${_FILE_PATH}/../../../../" ABSOLUTE)
endif()
# HIP is currently not supported for apple
if(NOT APPLE)