[llvm] [llvm-(min-)tblgen] Avoid redundant source compilation (PR #114494)

NAKAMURA Takumi via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 16 02:42:41 PST 2024


================
@@ -5,20 +5,17 @@ add_subdirectory(Basic)
 # code needed by the backends.
 add_subdirectory(Common)
 
-set(LLVM_LINK_COMPONENTS Support)
-
 # llvm-min-tablegen only contains a subset of backends necessary to
 # build llvm/include. It must not depend on TableGenCommon, as
 # TableGenCommon depends on this already to generate things such as
 # ValueType definitions.
+# Sources included in both, llvm-min-tblgen and llvm-tblgen, must be included
+# into LLVMTableGenBasic to avoid redundant compilation and problems with build
+# caches.
+# At least one source file must be included directly to avoid CMake problems.
+# E.g. CMake derives which linker to use from the types of sources added.
 add_tablegen(llvm-min-tblgen LLVM_HEADERS
-  TableGen.cpp
-  ARMTargetDefEmitter.cpp
-  Attributes.cpp
-  DirectiveEmitter.cpp
-  IntrinsicEmitter.cpp
-  RISCVTargetDefEmitter.cpp
-  VTEmitter.cpp
+  llvm-min-tblgen.cpp
----------------
chapuni wrote:

Meant, one `TableGen.cpp` for multiple instances. I don't think we need to create copied files.

`PARTIAL_SOURCES_INTENDED` will accept duplicates.

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


More information about the llvm-commits mailing list