-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
36 lines (29 loc) · 952 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.22)
project(mlir-gccjit
LANGUAGES C CXX
)
option(MLIR_GCCJIT_BUILD_TOOLS "Build mlir-gccjit tools" ON)
option(MLIR_GCCJIT_ENABLE_TEST "Enable test targets in build" ON)
set(LLVM_BUILD_TOOLS ${MLIR_GCCJIT_BUILD_TOOLS})
include(cmake/FindLLVM.cmake)
include(cmake/FindMLIR.cmake)
include(cmake/FindGCCJIT.cmake)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
include_directories(
${CMAKE_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/include
${MLIR_INCLUDE_DIRS}
${LLVM_INCLUDE_DIRS}
)
link_directories(${LLVM_BUILD_LIBRARY_DIR})
add_definitions(${LLVM_DEFINITIONS})
add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(tools)
if (MLIR_GCCJIT_ENABLE_TEST)
add_subdirectory(test)
endif ()