2020-04-22 23:15:05 +08:00
|
|
|
cmake_minimum_required(VERSION 3.13.4)
|
2020-04-05 01:15:44 +08:00
|
|
|
project(standalone-dialect LANGUAGES CXX C)
|
|
|
|
|
2021-01-10 20:11:35 +08:00
|
|
|
set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
|
|
|
|
|
2020-05-06 02:54:23 +08:00
|
|
|
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to")
|
|
|
|
|
2020-04-05 01:15:44 +08:00
|
|
|
find_package(MLIR REQUIRED CONFIG)
|
|
|
|
|
|
|
|
message(STATUS "Using MLIRConfig.cmake in: ${MLIR_DIR}")
|
|
|
|
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
|
|
|
|
|
|
|
|
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(MLIR_BINARY_DIR ${CMAKE_BINARY_DIR})
|
|
|
|
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${MLIR_CMAKE_DIR}")
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
|
|
|
|
include(TableGen)
|
|
|
|
include(AddLLVM)
|
|
|
|
include(AddMLIR)
|
|
|
|
include(HandleLLVMOptions)
|
|
|
|
|
|
|
|
include_directories(${LLVM_INCLUDE_DIRS})
|
|
|
|
include_directories(${MLIR_INCLUDE_DIRS})
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/include)
|
|
|
|
include_directories(${PROJECT_BINARY_DIR}/include)
|
|
|
|
link_directories(${LLVM_BUILD_LIBRARY_DIR})
|
|
|
|
add_definitions(${LLVM_DEFINITIONS})
|
|
|
|
|
|
|
|
add_subdirectory(include)
|
|
|
|
add_subdirectory(lib)
|
|
|
|
add_subdirectory(test)
|
|
|
|
add_subdirectory(standalone-opt)
|
2020-05-29 03:34:44 +08:00
|
|
|
add_subdirectory(standalone-translate)
|