-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (50 loc) · 1.43 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
59
60
61
62
63
64
65
66
cmake_minimum_required(VERSION 3.1...3.28)
project(
simpleconfig
VERSION 1.0.2
LANGUAGES C
)
set(CMAKE_C_STANDARD 11)
list(APPEND CMAKE_MODULE_PATH "${simpleconfig_SOURCE_DIR}/cmake")
include("macros")
option(SCONF_BUILD_SHARED "Build shared library" ON)
option(SCONF_BUILD_STATIC "Build static library" ON)
option(SCONF_BUILD_EXAMPLES "Build examples" OFF)
option(SCONF_BUILD_FUZZERS "Build fuzzer applications" OFF)
option(SCONF_ENABLE_TESTS "Enable tests" OFF)
option(SCONF_ENABLE_COVERAGE "Enable coverage report" OFF)
option(SCONF_ENABLE_ASAN "Enable address sanitizer" OFF)
option(SCONF_ENABLE_UBSAN "Enable undefined behaviour sanitizer" OFF)
option(SCONF_ENABLE_CLANG_TIDY "Enable linter 'clang-tidy'" OFF)
option(SCONF_ENABLE_CPPCHECK "Enable linter 'cppcheck'" OFF)
add_subdirectory(third_party)
if(SCONF_ENABLE_CLANG_TIDY)
enable_check_clang_tidy()
endif()
if(SCONF_ENABLE_CPPCHECK)
enable_check_cppcheck()
endif()
if(all_linters)
add_custom_target(check DEPENDS ${all_linters})
endif()
if(SCONF_ENABLE_ASAN)
enable_asan()
endif()
if(SCONF_ENABLE_UBSAN)
enable_ubsan()
endif()
add_subdirectory(src)
if(SCONF_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
if(SCONF_ENABLE_COVERAGE)
enable_coverage()
endif()
if(SCONF_ENABLE_TESTS)
enable_testing()
set(CMAKE_CTEST_ARGUMENTS --output-on-failure)
add_subdirectory(tests)
endif()
if(SCONF_BUILD_FUZZERS)
add_subdirectory(fuzz)
endif()