Skip to content

Commit

Permalink
SWDEV-415414 - Corrected the IMPORT_PREFIX path in FindHIP.cmake (#3308)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rocm-ci authored Aug 31, 2023
1 parent 56614f4 commit 9cb358b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cmake/FindHIP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9cb358b

Please sign in to comment.