Skip to content

Commit 9b16321

Browse files
committed
Add missing Windows presets
gcov, asan, lsan, and usan presets added
1 parent 7b88578 commit 9b16321

File tree

1 file changed

+136
-12
lines changed

1 file changed

+136
-12
lines changed

cmake/CMakeWindowsPresets.json

Lines changed: 136 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,151 @@
55
],
66
"configurePresets": [
77
{
8-
"name": "release",
9-
"description": "Windows preset for library developers",
10-
"generator": "Ninja Multi-Config",
11-
"binaryDir": "${sourceDir}/build",
12-
"inherits": [
13-
"root-config"
14-
],
15-
"cacheVariables": {
16-
"CMAKE_CXX_COMPILER": "cl"
17-
},
8+
"name": "base-Windows-ClangCL",
9+
"hidden": true,
1810
"condition": {
1911
"type": "equals",
2012
"lhs": "${hostSystemName}",
2113
"rhs": "Windows"
14+
},
15+
"inherits": [
16+
"root-config"
17+
],
18+
"cacheVariables": {
19+
"CMAKE_C_COMPILER": "cl",
20+
"CMAKE_CXX_COMPILER": "cl",
21+
"CMAKE_CONFIGURATION_TYPES": "Debug;RelWithDebInfo;Coverage;Asan;Lsan;Usan",
22+
"CMAKE_CXX_FLAGS": "/Wall /WX",
23+
"CMAKE_C_FLAGS": "/Wall /WX"
24+
}
25+
},
26+
{
27+
"name": "debug-base-Windows-ClangCL",
28+
"hidden": true,
29+
"inherits": [
30+
"base-Windows-ClangCL"
31+
],
32+
"cacheVariables": {
33+
"CMAKE_CXX_FLAGS_DEBUG": "/Zi /Od /MDd",
34+
"CMAKE_C_FLAGS_DEBUG": "/Zi /Od /MDd"
35+
}
36+
},
37+
{
38+
"name": "relwithdebinfo-base-Windows-ClangCL",
39+
"hidden": true,
40+
"inherits": [
41+
"base-Windows-ClangCL"
42+
],
43+
"cacheVariables": {
44+
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
45+
"CMAKE_CXX_FLAGS_RELWITHDEBINFO": "/O2 /Zi /MD",
46+
"CMAKE_C_FLAGS_RELWITHDEBINFO": "/O2 /Zi /MD"
47+
}
48+
},
49+
{
50+
"name": "release-base-Windows-ClangCL",
51+
"hidden": true,
52+
"inherits": [
53+
"base-Windows-ClangCL"
54+
],
55+
"cacheVariables": {
56+
"CMAKE_BUILD_TYPE": "Release",
57+
"CMAKE_CXX_FLAGS_RELEASE": "/O2 /DNDEBUG /MD",
58+
"CMAKE_C_FLAGS_RELEASE": "/O2 /DNDEBUG /MD"
59+
}
60+
},
61+
{
62+
"name": "coverage-base-Windows-ClangCL",
63+
"hidden": true,
64+
"inherits": [
65+
"base-Windows-ClangCL"
66+
],
67+
"cacheVariables": {
68+
"CMAKE_BUILD_TYPE": "Coverage",
69+
"CMAKE_CXX_FLAGS_COVERAGE": "-fprofile-instr-generate -fcoverage-mapping",
70+
"CMAKE_C_FLAGS_COVERAGE": "-fprofile-instr-generate -fcoverage-mapping",
71+
"CMAKE_LD_FLAGS_COVERAGE": "-fprofile-instr-generate"
72+
}
73+
},
74+
{
75+
"name": "asan-base-Windows-ClangCL",
76+
"hidden": true,
77+
"inherits": [
78+
"base-Windows-ClangCL"
79+
],
80+
"cacheVariables": {
81+
"CMAKE_BUILD_TYPE": "Asan",
82+
"CMAKE_CXX_FLAGS_ASAN": "-fsanitize=address",
83+
"CMAKE_C_FLAGS_ASAN": "-fsanitize=address",
84+
"CMAKE_LD_FLAGS_ASAN": "-fsanitize=address"
85+
}
86+
},
87+
{
88+
"name": "lsan-base-Windows-ClangCL",
89+
"hidden": true,
90+
"inherits": [
91+
"base-Windows-ClangCL"
92+
],
93+
"cacheVariables": {
94+
"CMAKE_BUILD_TYPE": "Lsan",
95+
"CMAKE_CXX_FLAGS_LSAN": "-fsanitize=leak",
96+
"CMAKE_C_FLAGS_LSAN": "-fsanitize=leak",
97+
"CMAKE_LD_FLAGS_LSAN": "-fsanitize=leak"
98+
}
99+
},
100+
{
101+
"name": "usan-base-Windows-ClangCL",
102+
"hidden": true,
103+
"inherits": [
104+
"base-Windows-ClangCL"
105+
],
106+
"cacheVariables": {
107+
"CMAKE_BUILD_TYPE": "Usan",
108+
"CMAKE_CXX_FLAGS_USAN": "-fsanitize=undefined",
109+
"CMAKE_C_FLAGS_USAN": "-fsanitize=undefined",
110+
"CMAKE_LD_FLAGS_USAN": "-fsanitize=undefined"
22111
}
23112
},
24113
{
25114
"name": "debug",
26-
"description": "Windows preset for library developers",
115+
"displayName": "Debug Build",
116+
"inherits": [
117+
"debug-base-Windows-ClangCL"
118+
]
119+
},
120+
{
121+
"name": "gcov",
122+
"displayName": "Coverage Build",
123+
"inherits": [
124+
"coverage-base-Windows-ClangCL"
125+
]
126+
},
127+
{
128+
"name": "release",
129+
"displayName": "Release Build",
130+
"inherits": [
131+
"relwithdebinfo-base-Windows-ClangCL"
132+
]
133+
},
134+
{
135+
"name": "asan",
136+
"displayName": "AddressSanitizer Build",
137+
"inherits": [
138+
"asan-base-Windows-ClangCL"
139+
]
140+
},
141+
{
142+
"name": "lsan",
143+
"displayName": "LeakSanitizer Build",
144+
"inherits": [
145+
"lsan-base-Windows-ClangCL"
146+
]
147+
},
148+
{
149+
"name": "usan",
150+
"displayName": "UndefinedSanitizer Build",
27151
"inherits": [
28-
"release"
152+
"usan-base-Windows-ClangCL"
29153
]
30154
}
31155
]

0 commit comments

Comments
 (0)