[llvm] [CMake] Create and link against object libraries for each component (PR #198720)

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 19 07:28:36 PDT 2026


================
@@ -994,7 +995,7 @@ function(add_llvm_component_library name)
     "COMPONENT_NAME;ADD_TO_COMPONENT"
     ""
     ${ARGN})
-  add_llvm_library(${name} COMPONENT_LIB ${ARG_UNPARSED_ARGUMENTS})
+  add_llvm_library(${name} COMPONENT_LIB OBJECT ${ARG_UNPARSED_ARGUMENTS})
----------------
tstellar wrote:

With clang, we build both static and object libraries, but I like your approach better because it's easier to disable the static library build.  Are there any other advantages to doing it this way?

https://github.com/llvm/llvm-project/pull/198720


More information about the llvm-commits mailing list