blob: 2028cc266b5c4e950a68102fdf019b02f2ae4b82 [file] [log] [blame]
# //===----------------------------------------------------------------------===//
# //
# // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# // See https://llvm.org/LICENSE.txt for details.
# // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# //
# //===----------------------------------------------------------------------===//
set(LLVM_LINK_COMPONENTS Support)
add_clang_tool(amdgpu-arch AMDGPUArch.cpp)
# If we find the HSA runtime we link with it directly.
find_package(hsa-runtime64 QUIET 1.2.0 HINTS ${CMAKE_INSTALL_PREFIX} PATHS /opt/rocm)
if (${hsa-runtime64_FOUND})
set_target_properties(amdgpu-arch PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON)
target_link_libraries(amdgpu-arch PRIVATE hsa-runtime64::hsa-runtime64)
else()
target_compile_definitions(amdgpu-arch PRIVATE "DYNAMIC_HSA")
endif()