xref: /llvm-project/mlir/examples/toy/Ch6/CMakeLists.txt (revision 34a35a8b244243f5a4ad5d531007bccfeaa0b02e)
1# This chapter depends on JIT support enabled.
2if(NOT MLIR_ENABLE_EXECUTION_ENGINE)
3  return()
4endif()
5
6
7# For a better template to copy, see examples/standalone
8include_directories(include)
9add_subdirectory(include)
10
11set(LLVM_LINK_COMPONENTS
12  Core
13  Support
14  nativecodegen
15  OrcJIT
16  )
17
18set(LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
19mlir_tablegen(ToyCombine.inc -gen-rewriters)
20add_public_tablegen_target(ToyCh6CombineIncGen)
21
22add_toy_chapter(toyc-ch6
23  toyc.cpp
24  parser/AST.cpp
25  mlir/MLIRGen.cpp
26  mlir/Dialect.cpp
27  mlir/LowerToAffineLoops.cpp
28  mlir/LowerToLLVM.cpp
29  mlir/ShapeInferencePass.cpp
30  mlir/ToyCombine.cpp
31
32  DEPENDS
33  ToyCh6ShapeInferenceInterfaceIncGen
34  ToyCh6OpsIncGen
35  ToyCh6CombineIncGen
36  )
37
38include_directories(${CMAKE_CURRENT_BINARY_DIR})
39include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
40get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
41get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
42get_property(extension_libs GLOBAL PROPERTY MLIR_EXTENSION_LIBS)
43target_link_libraries(toyc-ch6
44  PRIVATE
45    ${dialect_libs}
46    ${conversion_libs}
47    ${extension_libs}
48    MLIRAnalysis
49    MLIRBuiltinToLLVMIRTranslation
50    MLIRCallInterfaces
51    MLIRCastInterfaces
52    MLIRExecutionEngine
53    MLIRFunctionInterfaces
54    MLIRIR
55    MLIRLLVMCommonConversion
56    MLIRLLVMDialect
57    MLIRLLVMToLLVMIRTranslation
58    MLIRMemRefDialect
59    MLIRParser
60    MLIRPass
61    MLIRSideEffectInterfaces
62    MLIRSupport
63    MLIRTargetLLVMIRExport
64    MLIRTransforms
65    )
66