-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
44 lines (37 loc) · 1.16 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
cmake_minimum_required(VERSION 3.15)
project(relay-mlir LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 20)
if(MSVC)
add_compile_options(/wd4005 /wd4251 /wd4530 /wd4996)
else()
add_compile_options(
-frtti
-fexceptions
-Wno-macro-redefined
-Wno-suggest-override
-Wno-non-virtual-dtor
-Wno-cast-qual
)
endif()
set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
find_package(MLIR REQUIRED CONFIG)
find_package(fmt REQUIRED)
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})
link_directories(${PROJECT_BINARY_DIR}/lib)
add_definitions(${LLVM_DEFINITIONS})
add_subdirectory(include)
add_subdirectory(lib)
add_subdirectory(bin)