-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdditionalBuildTypes.cmake
115 lines (109 loc) · 5.65 KB
/
AdditionalBuildTypes.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# DebWithAsan Build Type
set(CMAKE_CXX_FLAGS_DEBWITHASAN "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address"
CACHE STRING "Flags used by the C++ compiler during DebWithAsan builds."
FORCE)
set(CMAKE_C_FLAGS_DEBWITHASAN "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address"
CACHE STRING "Flags used by the C compiler during DebWithAsan builds."
FORCE)
set(CMAKE_EXE_LINKER_FLAGS_DEBWITHASAN "${CMAKE_EXE_LINKER_FLAGS_DEBUG}"
CACHE STRING "Flags used for linking binaries during DebWithAsan builds."
FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_DEBWITHASAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}"
CACHE STRING "Flags used by the shared libraries linker during DebWithAsan builds."
FORCE)
mark_as_advanced(CMAKE_CXX_FLAGS_DEBWITHASAN
CMAKE_C_FLAGS_DEBWITHASAN
CMAKE_EXE_LINKER_FLAGS_DEBWITHASAN
CMAKE_SHARED_LINKER_FLAGS_DEBWITHASAN)
# DebWithTsan Build Type
set(CMAKE_CXX_FLAGS_DEBWITHTSAN "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=thread"
CACHE STRING "Flags used by the C++ compiler during DebWithTsan builds."
FORCE)
set(CMAKE_C_FLAGS_DEBWITHTSAN "${CMAKE_C_FLAGS_DEBUG} -fsanitize=thread"
CACHE STRING "Flags used by the C compiler during DebWithTsan builds."
FORCE)
set(CMAKE_EXE_LINKER_FLAGS_DEBWITHTSAN "${CMAKE_EXE_LINKER_FLAGS_DEBUG}"
CACHE STRING "Flags used for linking binaries during DebWithTsan builds."
FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_DEBWITHTSAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}"
CACHE STRING "Flags used by the shared libraries linker during DebWithTsan builds."
FORCE)
mark_as_advanced(CMAKE_CXX_FLAGS_DEBWITHTSAN
CMAKE_C_FLAGS_DEBWITHTSAN
CMAKE_EXE_LINKER_FLAGS_DEBWITHTSAN
CMAKE_SHARED_LINKER_FLAGS_DEBWITHTSAN)
# DebWithUBsan Build Type
set(CMAKE_CXX_FLAGS_DEBWITHUBSAN "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=undefined"
CACHE STRING "Flags used by the C++ compiler during DebWithUBsan builds."
FORCE)
set(CMAKE_C_FLAGS_DEBWITHUBSAN "${CMAKE_C_FLAGS_DEBUG} -fsanitize=undefined"
CACHE STRING "Flags used by the C compiler during DebWithUBsan builds."
FORCE)
set(CMAKE_EXE_LINKER_FLAGS_DEBWITHUBSAN "${CMAKE_EXE_LINKER_FLAGS_DEBUG}"
CACHE STRING "Flags used for linking binaries during DebWithUBsan builds."
FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_DEBWITHUBSAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}"
CACHE STRING "Flags used by the shared libraries linker during DebWithUBsan builds."
FORCE)
mark_as_advanced(CMAKE_CXX_FLAGS_DEBWITHUBSAN
CMAKE_C_FLAGS_DEBWITHUBSAN
CMAKE_EXE_LINKER_FLAGS_DEBWITHUBSAN
CMAKE_SHARED_LINKER_FLAGS_DEBWITHUBSAN)
# RelWithAsan Build Type
set(CMAKE_CXX_FLAGS_RELWITHASAN "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fsanitize=address"
CACHE STRING "Flags used by the C++ compiler during RelWithAsan builds."
FORCE)
set(CMAKE_C_FLAGS_RELWITHASAN "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fsanitize=address"
CACHE STRING "Flags used by the C compiler during RelWithAsan builds."
FORCE)
set(CMAKE_EXE_LINKER_FLAGS_RELWITHASAN "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}"
CACHE STRING "Flags used for linking binaries during RelWithAsan builds."
FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHASAN "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO}"
CACHE STRING "Flags used by the shared libraries linker during RelWithAsan builds."
FORCE)
mark_as_advanced(CMAKE_CXX_FLAGS_RELWITHASAN
CMAKE_C_FLAGS_RELWITHASAN
CMAKE_EXE_LINKER_FLAGS_RELWITHASAN
CMAKE_SHARED_LINKER_FLAGS_RELWITHASAN)
# RelWithTsan Build Type
set(CMAKE_CXX_FLAGS_RELWITHTSAN "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fsanitize=thread"
CACHE STRING "Flags used by the C++ compiler during RelWithTsan builds."
FORCE)
set(CMAKE_C_FLAGS_RELWITHTSAN "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fsanitize=thread"
CACHE STRING "Flags used by the C compiler during RelWithTsan builds."
FORCE)
set(CMAKE_EXE_LINKER_FLAGS_RELWITHTSAN "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}"
CACHE STRING "Flags used for linking binaries during RelWithTsan builds."
FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHTSAN "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO}"
CACHE STRING "Flags used by the shared libraries linker during RelWithTsan builds."
FORCE)
mark_as_advanced(CMAKE_CXX_FLAGS_RELWITHTSAN
CMAKE_C_FLAGS_RELWITHTSAN
CMAKE_EXE_LINKER_FLAGS_RELWITHTSAN
CMAKE_SHARED_LINKER_FLAGS_RELWITHTSAN)
# RelWithUBsan Build Type
set(CMAKE_CXX_FLAGS_RELWITHUBSAN "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fsanitize=undefined"
CACHE STRING "Flags used by the C++ compiler during RelWithUBsan builds."
FORCE)
set(CMAKE_C_FLAGS_RELWITHUBSAN "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fsanitize=undefined"
CACHE STRING "Flags used by the C compiler during RelWithUBsan builds."
FORCE)
set(CMAKE_EXE_LINKER_FLAGS_RELWITHUBSAN "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}"
CACHE STRING "Flags used for linking binaries during RelWithUBsan builds."
FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHUBSAN "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO}"
CACHE STRING "Flags used by the shared libraries linker during RelWithUBsan builds."
FORCE)
mark_as_advanced(CMAKE_CXX_FLAGS_RELWITHUBSAN
CMAKE_C_FLAGS_RELWITHUBSAN
CMAKE_EXE_LINKER_FLAGS_RELWITHUBSAN
CMAKE_SHARED_LINKER_FLAGS_RELWITHUBSAN)
# Update the documentation string of CMAKE_BUILD_TYPE for GUIs
set(
CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}"
CACHE
STRING
"Choose the type of build, options are: None Debug DebWithAsan DebWithTsan DebWithUBsan Release RelWithDebInfo MinSizeRel RelWithAsan RelWithTsan RelWithUBsan."
FORCE)