-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
37 lines (31 loc) · 1.45 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
cmake_minimum_required(VERSION 3.19)
project(tetl-dev LANGUAGES CXX)
option(TETL_BUILD_ASAN "Build with address sanitizer enabled" OFF)
option(TETL_BUILD_CONTRACT_CHECKS "Build with contract assertions" ON)
option(TETL_BUILD_CONTRACT_CHECKS_SAFE "Build with all/slow contract assertions" OFF)
option(TETL_BUILD_COVERAGE "Build with coverage reporting for gcc/clang" OFF)
option(TETL_BUILD_TIMETRACE "Build with -ftime-trace (clang only)" OFF)
option(TETL_BUILD_UBSAN "Build with undefined behavior sanitizer enabled" OFF)
option(TETL_BUILD_WERROR "Build with all warnings as errors" OFF)
option(TETL_BUILD_WEVERYTHING "Build with -Weverything (clang only)" OFF)
find_program(CCACHE ccache)
if(CCACHE)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
endif()
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 20)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(code_coverage)
include(compiler_options)
include(compiler_warnings)
enable_testing()
add_subdirectory(include)
add_subdirectory(tests)
add_subdirectory(examples)