From: Joseph Huber Date: Fri, 10 Feb 2023 14:22:05 +0000 (-0600) Subject: [amdgpu-arch] Fix build of amdgpu-arch with CLANG_LINK_CLANG_DYLIB X-Git-Tag: upstream/17.0.6~17938 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=067a5c68845c13d45e85ec9eaa11d2b2d829bab4;p=platform%2Fupstream%2Fllvm.git [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. --- diff --git a/clang/tools/amdgpu-arch/CMakeLists.txt b/clang/tools/amdgpu-arch/CMakeLists.txt index f57ee21..5b7ef13 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()