-
Notifications
You must be signed in to change notification settings - Fork 2
/
compiler_warnings.cmake
72 lines (66 loc) · 1.74 KB
/
compiler_warnings.cmake
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
67
68
69
70
71
72
add_library(compiler_warnings INTERFACE)
add_library(tetl::compiler_warnings ALIAS compiler_warnings)
if (MSVC)
target_compile_options(compiler_warnings
INTERFACE
/W3
$<$<BOOL:${TETL_BUILD_WERROR}>:/WX>
)
else ()
target_compile_options(compiler_warnings
INTERFACE
-Wall
-Wextra
-Wpedantic
$<$<BOOL:${TETL_BUILD_WERROR}>:-Werror>
-Wcast-align
-Wcast-qual
-Wdouble-promotion
-Wmissing-field-initializers
-Wnarrowing
-Woverloaded-virtual
-Wreorder
-Wshadow
-Wsign-compare
-Wsign-promo
-Wstrict-aliasing
-Wswitch-enum
-Wuninitialized
-Wunreachable-code
-Wunused-parameter
-Wzero-as-null-pointer-constant
-Wsign-conversion
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
-Wbool-conversion
-Wconditional-uninitialized
-Wconstant-conversion
-Wconversion
-Wextra-semi
-Winconsistent-missing-destructor-override
-Wint-conversion
-Wnullable-to-nonnull-conversion
-Wshadow-all
-Wshift-sign-overflow
-Wshorten-64-to-32
-Wunused-private-field
-Wreturn-type
$<$<BOOL:${TETL_BUILD_WEVERYTHING}>:
-Weverything
-Wno-c++98-compat-pedantic
-Wno-c++20-compat
-Wno-ctad-maybe-unsupported
-Wno-float-equal
-Wno-padded
-Wno-unused-member-function
-Wno-unsafe-buffer-usage
-Wno-weak-vtables
>
>
$<$<CXX_COMPILER_ID:GNU>:
-Wmisleading-indentation
-Wlogical-op
-Wduplicated-branches
-Wduplicated-cond
>
)
endif (MSVC)