11#[[
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.
83]]
94
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" )
1114
1215# ##############################################################################
13- # Sanitizer
16+ # Sanitizer - cmake-modules/build/Sanitizer.cmake
1417# ##############################################################################
1518
1619set (USE_SANITIZER
1720 OFF
1821 CACHE BOOL "Enable sanitizer" )
1922
20- include (cmake-modules/build /Sanitizer)
21-
2223# ##############################################################################
23- # Valgrind
24+ # Valgrind - cmake-modules/test/Valgrind.cmake
2425# ##############################################################################
2526
2627set (USE_VALGRIND
@@ -37,20 +38,16 @@ set(USE_VALGRIND_OPTIONS
3738 # Valgrind is unacceptably slow.
3839 CACHE STRING "valgrind options." )
3940
40- include (cmake-modules/test /Valgrind)
41-
4241# ##############################################################################
43- # Clang-Tidy
42+ # Clang-Tidy - cmake-modules/build/ClangTidy.cmake
4443# ##############################################################################
4544
4645set (USE_CLANGTIDY
4746 OFF
4847 CACHE BOOL "Enable Clang-Tidy" )
4948
50- include (cmake-modules/build /ClangTidy)
51-
5249# ##############################################################################
53- # Cppcheck
50+ # Cppcheck - cmake-modules/build/Cppcheck.cmake
5451# ##############################################################################
5552
5653set (USE_CPPCHECK
@@ -61,16 +58,8 @@ set(USE_CPPCHECK_SUPPRESSION_FILE
6158 CACHE STRING
6259 "Customize the path to the Cppcheck suppressions file of the project" )
6360
64- include (cmake-modules/build /Cppcheck)
65-
6661# ##############################################################################
67- # CompilerFlags
68- # ##############################################################################
69-
70- include (cmake-modules/build /CompilerFlags)
71-
72- # ##############################################################################
73- # Hardening
62+ # Hardening - cmake-modules/build/Hardening.cmake
7463# ##############################################################################
7564
7665# Comment `-Wl,-z,nodlopen` for dlopen call
@@ -105,9 +94,8 @@ if(NOT MSVC)
10594
10695 set (USE_HARDENING_LINKS
10796 -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
11199 -Wl,-z,noexecstack # Enable data execution prevention by marking stack
112100 # memory as non-executable
113101 -Wl,-z,relro # Mark relocation table entries resolved at load-time as
@@ -116,5 +104,3 @@ if(NOT MSVC)
116104 # read-only. It impacts startup performance
117105 CACHE STRING "Additional hardening linking flags for GCC/Clang" )
118106endif ()
119-
120- include (cmake-modules/build /Hardening)
0 commit comments