[llvm] [TargetParser][cmake] Be Smarter about TableGen Deps (PR #144848)

Jim Lin via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 19 00:16:13 PDT 2025


================
@@ -92,44 +93,33 @@ function(tablegen project ofn)
     list(APPEND LLVM_TABLEGEN_FLAGS "-no-warn-on-unused-template-args")
   endif()
 
-  # We need both _TABLEGEN_TARGET and _TABLEGEN_EXE in the  DEPENDS list
-  # (both the target and the file) to have .inc files rebuilt on
-  # a tablegen change, as cmake does not propagate file-level dependencies
-  # of custom targets. See the following ticket for more information:
-  # https://cmake.org/Bug/view.php?id=15858
-  # The dependency on both, the target and the file, produces the same
-  # dependency twice in the result file when
-  # ("${${project}_TABLEGEN_TARGET}" STREQUAL "${${project}_TABLEGEN_EXE}")
-  # but lets us having smaller and cleaner code here.
-  get_directory_property(tblgen_includes INCLUDE_DIRECTORIES)
-  list(APPEND tblgen_includes ${ARG_EXTRA_INCLUDES})
-
-  # Get the current set of include paths for this td file.
-  cmake_parse_arguments(ARG "" "" "DEPENDS;EXTRA_INCLUDES" ${ARGN})
-  get_directory_property(tblgen_includes INCLUDE_DIRECTORIES)
-  list(APPEND tblgen_includes ${ARG_EXTRA_INCLUDES})
-  # Filter out any empty include items.
-  list(REMOVE_ITEM tblgen_includes "")
-
-  # Build the absolute path for the current input file.
----------------
tclin914 wrote:

We shouldn't delete this comment.

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


More information about the llvm-commits mailing list