Skip to content

Commit 9cb358b

Browse files
authored
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
1 parent 56614f4 commit 9cb358b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cmake/FindHIP.cmake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,16 @@ elseif (HIP_CXX_COMPILER MATCHES ".*clang\\+\\+")
8181
set(HIP_CLANG_PATH "${_HIP_CLANG_BIN_PATH}")
8282
endif()
8383

84-
85-
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../" REALPATH)
84+
if(WIN32)
85+
# In windows FindHIP.cmake is installed in <Install_Prefix>/cmake
86+
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../" REALPATH)
87+
else()
88+
# In Linux FindHIP.cmake is installed in <Install_Prefix>/lib/cmake/hip
89+
# RealPath: <Install_Prefix>/lib/cmake/hip/FindHIP.cmake
90+
# Go 4 level up to get IMPORT PREFIX as <Install_Prefix>
91+
get_filename_component(_FILE_PATH "${CMAKE_CURRENT_LIST_FILE}" REALPATH)
92+
get_filename_component(_IMPORT_PREFIX "${_FILE_PATH}/../../../../" ABSOLUTE)
93+
endif()
8694

8795
# HIP is currently not supported for apple
8896
if(NOT APPLE)

0 commit comments

Comments
 (0)