Bryan Tan 35110b7b10
[mlir] Consistently add TableGen generated files as deps to mlir-headers/mlir-generic-headers CMake targets (#155474)
Tool targets like `mlir-opt` rely on the `mlir-headers` or
`mlir-generic-headers` targets to run first to generate headers.
However, many of the `IncGen` targets are not specified as dependencies
of the header targets in CMake, which causes spurious build failures when
using a high number of parallel build jobs.

Thus, this commit introduces a pair of new CMake macros
`add_mlir_dialect_tablegen_target` and
`add_mlir_generic_tablegen_target` to
`AddMLIR.cmake`, which can be used in place of
`add_public_tablegen_target` to
ensure (by convention) that `IncGen` targets are added to the
`mlir-headers`
(resp. `mlir-generic-headers`) target dependencies.

Most uses of `add_public_tablegen_target` in the dialects have been
refactored to use the new macros.
2025-08-27 10:40:48 +02:00
..