-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
31 lines (25 loc) · 1021 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
cmake_minimum_required(VERSION 3.28)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(ToyDT CXX)
message("Compiler path ${CMAKE_CXX_COMPILER}")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# require at least gcc 4.8
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.1)
message(FATAL_ERROR "G++ version must be at least 13.1, which is ${CMAKE_CXX_COMPILER_VERSION} now.")
endif ()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# require at least clang 3.2
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0.0)
message(FATAL_ERROR "Clang version must be at least 17, which is ${CMAKE_CXX_COMPILER_VERSION} now.")
endif ()
else ()
message(WARNING "You are using an unsupported compiler: ${CMAKE_CXX_COMPILER_ID}! Compilation has only been tested with Clang and GCC.")
endif ()
set(module_list)
find_package(FLEX REQUIRED)
find_package(BISON REQUIRED)
include_directories(src)
include_directories(grammar)
add_subdirectory(src)
add_subdirectory(bin)