summaryrefslogtreecommitdiff
path: root/gnu/llvm/clang/tools/amdgpu-arch/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/llvm/clang/tools/amdgpu-arch/CMakeLists.txt')
-rw-r--r--gnu/llvm/clang/tools/amdgpu-arch/CMakeLists.txt17
1 files changed, 9 insertions, 8 deletions
diff --git a/gnu/llvm/clang/tools/amdgpu-arch/CMakeLists.txt b/gnu/llvm/clang/tools/amdgpu-arch/CMakeLists.txt
index caead440c5c..2028cc266b5 100644
--- a/gnu/llvm/clang/tools/amdgpu-arch/CMakeLists.txt
+++ b/gnu/llvm/clang/tools/amdgpu-arch/CMakeLists.txt
@@ -6,14 +6,15 @@
# //
# //===----------------------------------------------------------------------===//
-find_package(hsa-runtime64 QUIET 1.2.0 HINTS ${CMAKE_INSTALL_PREFIX} PATHS /opt/rocm)
-if (NOT ${hsa-runtime64_FOUND})
- message(STATUS "Not building amdgpu-arch: hsa-runtime64 not found")
- return()
-endif()
+set(LLVM_LINK_COMPONENTS Support)
add_clang_tool(amdgpu-arch AMDGPUArch.cpp)
-set_target_properties(amdgpu-arch PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON)
-
-clang_target_link_libraries(amdgpu-arch PRIVATE hsa-runtime64::hsa-runtime64)
+# 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()