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(ToyCh7CombineIncGen) 15 16add_toy_chapter(toyc-ch7 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 ToyCh7ShapeInferenceInterfaceIncGen 28 ToyCh7OpsIncGen 29 ToyCh7CombineIncGen 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-ch7 37 PRIVATE 38 ${dialect_libs} 39 ${conversion_libs} 40 MLIRAnalysis 41 MLIRCallInterfaces 42 MLIRExecutionEngine 43 MLIRIR 44 MLIRParser 45 MLIRPass 46 MLIRSideEffectInterfaces 47 MLIRTargetLLVMIR 48 MLIRTransforms 49 ) 50