[clang] 067a5c6 - [amdgpu-arch] Fix build of amdgpu-arch with CLANG_LINK_CLANG_DYLIB
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 10 06:24:08 PST 2023
Author: Joseph Huber
Date: 2023-02-10T08:23:49-06:00
New Revision: 067a5c68845c13d45e85ec9eaa11d2b2d829bab4
URL: https://github.com/llvm/llvm-project/commit/067a5c68845c13d45e85ec9eaa11d2b2d829bab4
DIFF: https://github.com/llvm/llvm-project/commit/067a5c68845c13d45e85ec9eaa11d2b2d829bab4.diff
LOG: [amdgpu-arch] Fix build of amdgpu-arch with CLANG_LINK_CLANG_DYLIB
The function clang_target_link_libraries must only be used with real
Clang libraries; with CLANG_LINK_CLANG_DYLIB, it will instead link in
clang-cpp. We must use the standard CMake target_link_libraries for
the HSA library.
Added:
Modified:
clang/tools/amdgpu-arch/CMakeLists.txt
Removed:
################################################################################
diff --git a/clang/tools/amdgpu-arch/CMakeLists.txt b/clang/tools/amdgpu-arch/CMakeLists.txt
index f57ee216b0934..5b7ef13924b8e 100644
--- a/clang/tools/amdgpu-arch/CMakeLists.txt
+++ b/clang/tools/amdgpu-arch/CMakeLists.txt
@@ -14,7 +14,7 @@ add_clang_tool(amdgpu-arch AMDGPUArch.cpp)
find_package(hsa-runtime64 QUIET 1.2.0 HINTS ${CMAKE_INSTALL_PREFIX} PATHS /opt/rocm)
if(hsa-runtime64_FOUND AND NOT (LLVM_BUILD_32_BITS OR CMAKE_SIZEOF_VOID_P EQUAL 4))
set_target_properties(amdgpu-arch PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON)
- clang_target_link_libraries(amdgpu-arch PRIVATE hsa-runtime64::hsa-runtime64)
+ target_link_libraries(amdgpu-arch PRIVATE hsa-runtime64::hsa-runtime64)
else()
target_compile_definitions(amdgpu-arch PRIVATE "DYNAMIC_HSA")
endif()
More information about the cfe-commits
mailing list