-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
59 lines (45 loc) · 1.44 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
cmake_minimum_required (VERSION 3.12)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
macro(add_cxx_flag flag)
message(STATUS "Configure with flag '${flag}'")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
endmacro()
project (ethos_checker)
# >> 2-valued: ON OFF
# > for options where we don't need to detect if set by user (default: OFF)
option(ENABLE_ORACLES "Enable support for Oracles" ON)
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(GMP REQUIRED)
set(LIBRARIES ${LIBRARIES} ${GMP_LIBRARIES})
include_directories(${GMP_INCLUDE_DIR})
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "Defaulting to release build.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "" FORCE)
endif()
add_cxx_flag("-Wall")
add_cxx_flag("-Wno-deprecated")
add_cxx_flag("-std=gnu++17")
if(WIN32)
add_definitions(-DUSE_CPP_FILESYSTEM)
if(ENABLE_ORACLES)
message(STATUS "Disabling Oracles since they are not supported on Windows.")
set(ENABLE_ORACLES OFF)
endif()
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_cxx_flag("-g")
add_definitions(-DEO_ASSERTIONS)
add_definitions(-DEO_TRACING)
message(STATUS "Configured debug build.")
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
message(STATUS "Configured release build.")
else()
message(FATAL_ERROR "Invalid build type '${CMAKE_BUILD_TYPE}'")
endif()
if(ENABLE_ORACLES)
add_definitions(-DEO_ORACLES)
endif()
enable_testing()
include_directories(src)
add_subdirectory(src)
add_subdirectory(tests)