1set(LLVM_TARGET_DEFINITIONS enums.td)
2mlir_tablegen(EnumsGenTest.h.inc -gen-enum-decls)
3mlir_tablegen(EnumsGenTest.cpp.inc -gen-enum-defs)
4add_public_tablegen_target(MLIRTableGenEnumsIncGen)
5
6set(LLVM_TARGET_DEFINITIONS structs.td)
7mlir_tablegen(StructAttrGenTest.h.inc -gen-struct-attr-decls)
8mlir_tablegen(StructAttrGenTest.cpp.inc -gen-struct-attr-defs)
9add_public_tablegen_target(MLIRTableGenStructAttrIncGen)
10
11add_mlir_unittest(MLIRTableGenTests
12  EnumsGenTest.cpp
13  StructsGenTest.cpp
14  FormatTest.cpp
15  OpBuildGen.cpp
16)
17
18add_dependencies(MLIRTableGenTests MLIRTableGenEnumsIncGen)
19add_dependencies(MLIRTableGenTests MLIRTableGenStructAttrIncGen)
20add_dependencies(MLIRTableGenTests MLIRTestDialect)
21
22include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../test/lib/Dialect/Test)
23include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../test/lib/Dialect/Test)
24
25target_link_libraries(MLIRTableGenTests
26  PRIVATE MLIRTableGen MLIRIR
27  PUBLIC MLIRTestDialect
28)
29