set(LLVM_OPTIONAL_SOURCES
  TestDialect.cpp
  TestPatterns.cpp
)

set(LLVM_TARGET_DEFINITIONS TestOps.td)
mlir_tablegen(TestOps.h.inc -gen-op-decls)
mlir_tablegen(TestOps.cpp.inc -gen-op-defs)
mlir_tablegen(TestPatterns.inc -gen-rewriters)
add_public_tablegen_target(MLIRTestOpsIncGen)

add_llvm_library(MLIRTestDialect
  TestDialect.cpp
  TestPatterns.cpp
)
add_dependencies(MLIRTestDialect
  MLIRTestOpsIncGen
  MLIRIR
  LLVMSupport
)
target_link_libraries(MLIRTestDialect
  MLIRDialect
  MLIRIR
  LLVMSupport
)

set(LLVM_OPTIONAL_SOURCES
  TestDialect.cpp
  TestPatterns.cpp
)

set(LLVM_TARGET_DEFINITIONS TestOps.td)
mlir_tablegen(TestOps.h.inc -gen-op-decls)
mlir_tablegen(TestOps.cpp.inc -gen-op-defs)
mlir_tablegen(TestPatterns.inc -gen-rewriters)
add_public_tablegen_target(MLIRTestOpsIncGen)

add_llvm_library(MLIRTestDialect
  TestDialect.cpp
  TestPatterns.cpp
)
add_dependencies(MLIRTestDialect
  MLIRTestOpsIncGen
  MLIRIR
  LLVMSupport
  MLIRTypeInferOpInterfaceIncGen
)
target_link_libraries(MLIRTestDialect
  MLIRDialect
  MLIRIR
  LLVMSupport
)

Add missing dependency on the TypeInferOpInterface from the Test dialect
Add missing dependency on the TypeInferOpInterface from the Test dialect

This is fixing a build failure, usually non-deterministic because of
parallelism in the build, but could be reliably reproduced:

ninja projects/mlir/test/lib/TestDialect/CMakeFiles/MLIRTestDialect.dir/TestPatterns.cpp.o

PiperOrigin-RevId: 272998436
