@@ -14,16 +14,10 @@ target_compile_features(errors PRIVATE cxx_std_20)
14
14
15
15
# Check if this project is the main project
16
16
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR )
17
- option (CHECK_FORMAT "Enable source code formatting check" OFF )
18
- option (CHECK_WARNING "Enable static analysis warning check" OFF )
19
- option (CHECK_COVERAGE "Enable test coverage check" OFF )
20
17
option (BUILD_DOCS "Enable documentations build" OFF )
21
18
22
19
# Import Format.cmake to format source code
23
- if (CHECK_FORMAT )
24
- cpmaddpackage ("gh:threeal/Format.cmake#auto-install-cmake-format" )
25
- add_dependencies (errors fix-format )
26
- endif ()
20
+ cpmaddpackage ("gh:threeal/Format.cmake#auto-install-cmake-format" )
27
21
28
22
if (BUILD_TESTING )
29
23
enable_testing ()
@@ -43,16 +37,14 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
43
37
44
38
foreach (TARGET IN LISTS TARGETS )
45
39
# Statically analyze code by checking for warnings
46
- if (CHECK_WARNING )
47
- if (MSVC )
48
- target_compile_options (${TARGET} PRIVATE /WX /permissive- /W4 /w14640 /EHsc )
49
- else ()
50
- target_compile_options (${TARGET} PRIVATE -Werror -Wall -Wextra -Wnon-virtual-dtor -Wpedantic )
51
- endif ()
40
+ if (MSVC )
41
+ target_compile_options (${TARGET} PRIVATE /WX /permissive- /W4 /w14640 /EHsc )
42
+ else ()
43
+ target_compile_options (${TARGET} PRIVATE -Werror -Wall -Wextra -Wnon-virtual-dtor -Wpedantic )
52
44
endif ()
53
45
54
46
# Enable support to check for test coverage
55
- if (BUILD_TESTING AND CHECK_COVERAGE AND NOT MSVC )
47
+ if (BUILD_TESTING AND NOT MSVC )
56
48
target_compile_options (${TARGET} PRIVATE --coverage -O0 )
57
49
target_link_options (${TARGET} PRIVATE --coverage )
58
50
endif ()
0 commit comments