1# For a better template to copy, see examples/standalone
2include_directories(include)
3add_subdirectory(include)
4
5set(LLVM_LINK_COMPONENTS
6  Core
7  Support
8  nativecodegen
9  OrcJIT
10  )
11
12set(LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
13mlir_tablegen(ToyCombine.inc -gen-rewriters)
14add_public_tablegen_target(ToyCh6CombineIncGen)
15
16add_toy_chapter(toyc-ch6
17  toyc.cpp
18  parser/AST.cpp
19  mlir/MLIRGen.cpp
20  mlir/Dialect.cpp
21  mlir/LowerToAffineLoops.cpp
22  mlir/LowerToLLVM.cpp
23  mlir/ShapeInferencePass.cpp
24  mlir/ToyCombine.cpp
25
26  DEPENDS
27  ToyCh6ShapeInferenceInterfaceIncGen
28  ToyCh6OpsIncGen
29  ToyCh6CombineIncGen
30  )
31
32include_directories(${CMAKE_CURRENT_BINARY_DIR})
33include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
34get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
35get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
36target_link_libraries(toyc-ch6
37  PRIVATE
38    ${dialect_libs}
39    ${conversion_libs}
40    MLIRAnalysis
41    MLIRCallInterfaces
42    MLIRExecutionEngine
43    MLIRIR
44    MLIRLLVMIR
45    MLIRParser
46    MLIRPass
47    MLIRSideEffectInterfaces
48    MLIRSupport
49    MLIRTargetLLVMIR
50    MLIRTransforms
51    )
52