[clang] [lld] Add the type to target_link_libraries (PR #133596)
Theo Paris via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 29 13:26:28 PDT 2025
https://github.com/theoparis created https://github.com/llvm/llvm-project/pull/133596
This fixes building with LLVM_TOOL_LLVM_DRIVER_BUILD and LLVM_LINK_LLVM_DYLIB set to true. CMake requires that "all uses of target_link_libraries with a target must be either all-keyword or all-plain".
>From 183eac555a5aaf1ec0d2bd208506131351093a81 Mon Sep 17 00:00:00 2001
From: Theo Paris <theo at tinted.dev>
Date: Sat, 29 Mar 2025 13:15:58 -0700
Subject: [PATCH] [cmake] Add type to target_link_libraries
This fixes building with LLVM_TOOL_LLVM_DRIVER_BUILD and LLVM_LINK_LLVM_DYLIB set to true. Cmake requires that "all uses of target_link_libraries with a target must be either all-keyword or all-plain".
---
clang/cmake/modules/AddClang.cmake | 2 +-
lld/tools/lld/CMakeLists.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake
index cdc8bd5cd503b..45dd60206195d 100644
--- a/clang/cmake/modules/AddClang.cmake
+++ b/clang/cmake/modules/AddClang.cmake
@@ -213,7 +213,7 @@ endmacro()
function(clang_target_link_libraries target type)
if (TARGET obj.${target})
- target_link_libraries(obj.${target} ${ARGN})
+ target_link_libraries(obj.${target} ${type} ${ARGN})
endif()
get_property(LLVM_DRIVER_TOOLS GLOBAL PROPERTY LLVM_DRIVER_TOOLS)
diff --git a/lld/tools/lld/CMakeLists.txt b/lld/tools/lld/CMakeLists.txt
index 8498a91597a93..1d1a7ff448b7c 100644
--- a/lld/tools/lld/CMakeLists.txt
+++ b/lld/tools/lld/CMakeLists.txt
@@ -13,7 +13,7 @@ export_executable_symbols_for_plugins(lld)
function(lld_target_link_libraries target type)
if (TARGET obj.${target})
- target_link_libraries(obj.${target} ${ARGN})
+ target_link_libraries(obj.${target} ${type} ${ARGN})
endif()
get_property(LLVM_DRIVER_TOOLS GLOBAL PROPERTY LLVM_DRIVER_TOOLS)
More information about the llvm-commits
mailing list