diff --git a/CMakeLists.txt b/CMakeLists.txt index 4929982..78a60da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,8 +57,28 @@ if (NOT PREPARE_BUILTINS) set (PREPARE_BUILTINS $) endif() +# Following variables are required for ROCM backwards compatibility, +# and should be removed in ROCM 7.0 release. +set(ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_NEW "" CACHE STRING "New bitcode install location relative to CMAKE_INSTALL_PREFIX") +set(ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_OLD "" CACHE STRING "Old bitcode install location relative to CMAKE_INSTALL_PREFIX") + include(OCL) +if (NOT ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_NEW STREQUAL "" AND + NOT ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_OLD STREQUAL "") + set(ROCM_DEVICE_LIBS_WRAPPER_DIR ${CMAKE_CURRENT_BINARY_DIR}/wrapper_dir) + file(MAKE_DIRECTORY ${ROCM_DEVICE_LIBS_WRAPPER_DIR}) + add_custom_target( + FILE_REORG_ROCM_6_0 ALL + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${CMAKE_COMMAND} -E create_symlink + ${ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_NEW} + ${ROCM_DEVICE_LIBS_WRAPPER_DIR}/${ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_OLD}) + install( + FILES ${ROCM_DEVICE_LIBS_WRAPPER_DIR}/${ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_OLD} + DESTINATION .) +endif() + set(AMDGCN_LIB_LIST) set(AMDGCN_DEP_LIST) add_subdirectory(irif) diff --git a/cmake/OCL.cmake b/cmake/OCL.cmake index 1664c5d..83e2e30 100644 --- a/cmake/OCL.cmake +++ b/cmake/OCL.cmake @@ -39,6 +39,10 @@ set (STRIP_SUFFIX ".strip${BC_EXT}") set (FINAL_SUFFIX "${BC_EXT}") set (INSTALL_ROOT_SUFFIX "amdgcn/bitcode") +if (NOT ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_NEW STREQUAL "") + set(INSTALL_ROOT_SUFFIX "${ROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_NEW}/bitcode") +endif() + # Set `inc_options` to contain Clang command-line for include directories for # current source directory. macro(set_inc_options)