1
1
#[[
2
- This file configures the following things:
3
- - dynamic tools: sanitizers, valgrind.
4
- - static tools: clang-tidy, cppcheck.
5
- - compiler flags
6
- - hardening options
7
-
2
+ ProjectOptions.cmake - Defines project-specific options for CMake.
8
3
]]
9
4
10
- include_guard (GLOBAL )
5
+ set (CMAKE_CXX_STANDARD
6
+ 20
7
+ CACHE STRING "C++ standard" )
8
+ set (CMAKE_CXX_STANDARD_REQUIRED
9
+ ON
10
+ CACHE BOOL "C++ standard required" )
11
+ set (CMAKE_CXX_EXTENSIONS
12
+ OFF
13
+ CACHE BOOL "C++ extensions" )
11
14
12
15
# ##############################################################################
13
- # Sanitizer
16
+ # Sanitizer - cmake-modules/build/Sanitizer.cmake
14
17
# ##############################################################################
15
18
16
19
set (USE_SANITIZER
17
20
OFF
18
21
CACHE BOOL "Enable sanitizer" )
19
22
20
- include (cmake-modules/build /Sanitizer)
21
-
22
23
# ##############################################################################
23
- # Valgrind
24
+ # Valgrind - cmake-modules/test/Valgrind.cmake
24
25
# ##############################################################################
25
26
26
27
set (USE_VALGRIND
@@ -37,20 +38,16 @@ set(USE_VALGRIND_OPTIONS
37
38
# Valgrind is unacceptably slow.
38
39
CACHE STRING "valgrind options." )
39
40
40
- include (cmake-modules/test /Valgrind)
41
-
42
41
# ##############################################################################
43
- # Clang-Tidy
42
+ # Clang-Tidy - cmake-modules/build/ClangTidy.cmake
44
43
# ##############################################################################
45
44
46
45
set (USE_CLANGTIDY
47
46
OFF
48
47
CACHE BOOL "Enable Clang-Tidy" )
49
48
50
- include (cmake-modules/build /ClangTidy)
51
-
52
49
# ##############################################################################
53
- # Cppcheck
50
+ # Cppcheck - cmake-modules/build/Cppcheck.cmake
54
51
# ##############################################################################
55
52
56
53
set (USE_CPPCHECK
@@ -61,16 +58,8 @@ set(USE_CPPCHECK_SUPPRESSION_FILE
61
58
CACHE STRING
62
59
"Customize the path to the Cppcheck suppressions file of the project" )
63
60
64
- include (cmake-modules/build /Cppcheck)
65
-
66
61
# ##############################################################################
67
- # CompilerFlags
68
- # ##############################################################################
69
-
70
- include (cmake-modules/build /CompilerFlags)
71
-
72
- # ##############################################################################
73
- # Hardening
62
+ # Hardening - cmake-modules/build/Hardening.cmake
74
63
# ##############################################################################
75
64
76
65
# Comment `-Wl,-z,nodlopen` for dlopen call
@@ -105,9 +94,8 @@ if(NOT MSVC)
105
94
106
95
set (USE_HARDENING_LINKS
107
96
-fstack-protector-strong # Enable stack protector
108
- "-fsanitize=undefined -fsanitize-minimal-runtime" # Enable minimal runtime
109
- # undefined behavior sanitizer -Wl,-z,nodlopen # Restrict dlopen(3) calls
110
- # to shared objects
97
+ "-fsanitize=undefined -fsanitize-minimal-runtime"
98
+ # -Wl,-z,nodlopen # Restrict dlopen(3) calls to shared objects
111
99
-Wl,-z,noexecstack # Enable data execution prevention by marking stack
112
100
# memory as non-executable
113
101
-Wl,-z,relro # Mark relocation table entries resolved at load-time as
@@ -116,5 +104,3 @@ if(NOT MSVC)
116
104
# read-only. It impacts startup performance
117
105
CACHE STRING "Additional hardening linking flags for GCC/Clang" )
118
106
endif ()
119
-
120
- include (cmake-modules/build /Hardening)
0 commit comments