From 1b40df1de7a4b3664a55becd776c250f20db0041 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 13 Mar 2023 12:38:04 -0500 Subject: [PATCH] [Clang] Fix not including clangBasic in the dynamic build Summary: The previous patch only included the needed library if you had HSA and CUDA installed. Fix that. --- clang/tools/amdgpu-arch/CMakeLists.txt | 4 ++-- clang/tools/nvptx-arch/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clang/tools/amdgpu-arch/CMakeLists.txt b/clang/tools/amdgpu-arch/CMakeLists.txt index cc65217..4349fb9 100644 --- a/clang/tools/amdgpu-arch/CMakeLists.txt +++ b/clang/tools/amdgpu-arch/CMakeLists.txt @@ -14,8 +14,8 @@ 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) - target_link_libraries(amdgpu-arch PRIVATE hsa-runtime64::hsa-runtime64) - clang_target_link_libraries(amdgpu-arch PRIVATE clangBasic) + target_link_libraries(amdgpu-arch PRIVATE hsa-runtime64::hsa-runtime64 clangBasic) else() target_compile_definitions(amdgpu-arch PRIVATE "DYNAMIC_HSA") + target_link_libraries(amdgpu-arch PRIVATE clangBasic) endif() diff --git a/clang/tools/nvptx-arch/CMakeLists.txt b/clang/tools/nvptx-arch/CMakeLists.txt index 1bbff79..3444cf5b 100644 --- a/clang/tools/nvptx-arch/CMakeLists.txt +++ b/clang/tools/nvptx-arch/CMakeLists.txt @@ -13,8 +13,8 @@ find_package(CUDAToolkit QUIET) # If we found the CUDA library directly we just dynamically link against it. if(CUDAToolkit_FOUND AND NOT (LLVM_BUILD_32_BITS OR CMAKE_SIZEOF_VOID_P EQUAL 4)) - target_link_libraries(nvptx-arch PRIVATE CUDA::cuda_driver) - clang_target_link_libraries(nvptx-arch PRIVATE clangBasic) + target_link_libraries(nvptx-arch PRIVATE CUDA::cuda_driver clangBasic) else() target_compile_definitions(nvptx-arch PRIVATE "DYNAMIC_CUDA") + target_link_libraries(nvptx-arch PRIVATE clangBasic) endif() -- 2.7.4