diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2019-04-24 10:53:07 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2019-04-24 10:53:07 -0600 |
commit | 22bb32ed1b9505ae49145ca7765def6398f4803d (patch) | |
tree | fce88de88ed7ffda0856fb4798d0be58460d07c3 /CMakeLists.txt | |
download | mlir-toy-22bb32ed1b9505ae49145ca7765def6398f4803d.tar.gz mlir-toy-22bb32ed1b9505ae49145ca7765def6398f4803d.tar.bz2 mlir-toy-22bb32ed1b9505ae49145ca7765def6398f4803d.zip |
Initial commit
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..0c4cdfc --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,58 @@ +cmake_minimum_required(VERSION 3.12) +project(toyc) + +set(CMAKE_CXX_STANDARD 14) + +find_package(LLVM CONFIG PATHS "${MLIR_INSTALL_PREFIX}" NO_DEFAULT_PATH) + +if (LLVM_FOUND) + message(STATUS "Using LLVM ${LLVM_PACKAGE_VERSION} at ${LLVM_INSTALL_PREFIX}") +else() + message(FATAL_ERROR "LLVM not found; it is derived from MLIR_INSTALL_PREFIX which has value of ${MLIR_INSTALL_PREFIX}") +endif() + +llvm_map_components_to_libnames(llvm_libs support) + +if (NOT ${LLVM_ENABLE_RTTI}) + set(CMAKE_CXX_FLAGS "-fno-rtti ${CMAKE_CXX_FLAGS}") +endif() + +include_directories( + include + ${LLVM_INCLUDE_DIR}) + +link_directories(${LLVM_LIBRARY_DIR}) + +add_definitions(${LLVM_DEFINITIONS}) + +add_executable(toyc + toyc.cpp + parser/AST.cpp + mlir/EarlyLowering.cpp + mlir/LateLowering.cpp + mlir/MLIRGen.cpp + mlir/ShapeInferencePass.cpp + mlir/ToyDialect.cpp + mlir/ToyCombine.cpp + ) + +SET(WHOLE_ARCHIEVE -Wl,--whole-archive MLIRStandardOps MLIRAffineOps -Wl,--no-whole-archive) +target_link_libraries(toyc + PRIVATE + ${llvm_libs} + Linalg3DialectConstruction + Linalg3 + Linalg2 + Linalg1 + ${WHOLE_ARCHIEVE} + MLIRAnalysis + MLIREDSC + MLIRExecutionEngine + MLIRIR + MLIRLLVMIR + MLIRParser + MLIRPass + MLIRTargetLLVMIR + MLIRTransforms + MLIRSupport + ) |