-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
36 lines (29 loc) · 933 Bytes
/
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
cmake_minimum_required(VERSION 3.10.0)
project(toy VERSION 0.1.0 LANGUAGES CXX C)
set(LLVM_DIR /usr/lib/llvm-18/lib/cmake/llvm/)
find_package(LLVM REQUIRED CONFIG)
set(MLIR_DIR /usr/lib/llvm-18/lib/cmake/mlir/)
find_package(MLIR REQUIRED CONFIG)
include_directories(${LLVM_INCLUDE_DIRS})
include_directories(${MLIR_INCLUDE_DIRS})
list(APPEND CMAKE_MODULE_PATH "${MLIR_CMAKE_DIR}")
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
include(TableGen)
include(AddLLVM)
include(AddMLIR)
include(HandleLLVMOptions)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
add_custom_target(Toy)
macro(add_toy_chapter name)
add_dependencies(Toy ${name})
add_llvm_example(${name} ${ARGN})
endmacro(add_toy_chapter name)
add_subdirectory(Ch1)
add_subdirectory(Ch2)
add_subdirectory(Ch3)
add_subdirectory(Ch4)
add_subdirectory(Ch5)
add_subdirectory(Ch6)
add_subdirectory(Ch7)