| 1 |
# //===----------------------------------------------------------------------===// |
| 2 |
# // |
| 3 |
# // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 |
# // See https://llvm.org/LICENSE.txt for details. |
| 5 |
# // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 |
# // |
| 7 |
# //===----------------------------------------------------------------------===// |
| 8 |
|
| 9 |
set(LLVM_LINK_COMPONENTS Support) |
| 10 |
|
| 11 |
add_clang_tool(amdgpu-arch AMDGPUArch.cpp) |
| 12 |
|
| 13 |
# If we find the HSA runtime we link with it directly. |
| 14 |
find_package(hsa-runtime64 QUIET 1.2.0 HINTS ${CMAKE_INSTALL_PREFIX} PATHS /opt/rocm) |
| 15 |
if (${hsa-runtime64_FOUND}) |
| 16 |
set_target_properties(amdgpu-arch PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON) |
| 17 |
target_link_libraries(amdgpu-arch PRIVATE hsa-runtime64::hsa-runtime64) |
| 18 |
else() |
| 19 |
target_compile_definitions(amdgpu-arch PRIVATE "DYNAMIC_HSA") |
| 20 |
endif() |