• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1cmake_minimum_required(VERSION 3.13.4)
2
3if(POLICY CMP0068)
4  cmake_policy(SET CMP0068 NEW)
5  set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
6endif()
7
8if(POLICY CMP0075)
9  cmake_policy(SET CMP0075 NEW)
10endif()
11
12if(POLICY CMP0077)
13  cmake_policy(SET CMP0077 NEW)
14endif()
15
16project(standalone-dialect LANGUAGES CXX C)
17
18set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to")
19
20find_package(MLIR REQUIRED CONFIG)
21
22message(STATUS "Using MLIRConfig.cmake in: ${MLIR_DIR}")
23message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
24
25set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/bin)
26set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/lib)
27set(MLIR_BINARY_DIR ${CMAKE_BINARY_DIR})
28
29list(APPEND CMAKE_MODULE_PATH "${MLIR_CMAKE_DIR}")
30list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
31include(TableGen)
32include(AddLLVM)
33include(AddMLIR)
34include(HandleLLVMOptions)
35
36include_directories(${LLVM_INCLUDE_DIRS})
37include_directories(${MLIR_INCLUDE_DIRS})
38include_directories(${PROJECT_SOURCE_DIR}/include)
39include_directories(${PROJECT_BINARY_DIR}/include)
40link_directories(${LLVM_BUILD_LIBRARY_DIR})
41add_definitions(${LLVM_DEFINITIONS})
42
43add_subdirectory(include)
44add_subdirectory(lib)
45add_subdirectory(test)
46add_subdirectory(standalone-opt)
47add_subdirectory(standalone-translate)
48