Skip to content

Commit 270d10d

Browse files
committed
Restructure CMake Presets
1 parent a3fab15 commit 270d10d

File tree

4 files changed

+130
-61
lines changed

4 files changed

+130
-61
lines changed

CMakePresets.json

Lines changed: 8 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,12 @@
11
{
2-
"version": 6,
3-
"configurePresets": [
4-
{
5-
"name": "root-config",
6-
"hidden": true,
7-
"generator": "Ninja",
8-
"binaryDir": "${sourceDir}/build/${presetName}",
9-
"installDir": "${sourceDir}/stagedir",
10-
"cacheVariables": {
11-
"CMAKE_PREFIX_PATH": {
12-
"type": "path",
13-
"value": "${sourceDir}/stagedir"
14-
},
15-
"CMAKE_CXX_EXTENSIONS": false,
16-
"CMAKE_CXX_STANDARD": "23",
17-
"CMAKE_CXX_STANDARD_REQUIRED": true,
18-
"CMAKE_EXPORT_COMPILE_COMMANDS": true
19-
}
20-
},
21-
{
22-
"name": "debug-base-unix",
23-
"hidden": true,
24-
"cacheVariables": {
25-
"CMAKE_BUILD_TYPE": "Debug",
26-
"CMAKE_CXX_FLAGS": "-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined"
27-
},
28-
"condition": {
29-
"type": "notEquals",
30-
"lhs": "${hostSystemName}",
31-
"rhs": "Windows"
32-
}
33-
},
34-
{
35-
"name": "release-base-unix",
36-
"hidden": true,
37-
"cacheVariables": {
38-
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
39-
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Wno-shadow -Wconversion -Wsign-conversion -Wcast-align -Wcast-qual -Woverloaded-virtual -Wformat=2 -Wno-error"
40-
},
41-
"condition": {
42-
"type": "notEquals",
43-
"lhs": "${hostSystemName}",
44-
"rhs": "Windows"
45-
}
46-
},
47-
{
48-
"name": "debug",
49-
"displayName": "Debug Build",
50-
"inherits": [
51-
"root-config",
52-
"debug-base-unix"
53-
]
54-
},
55-
{
56-
"name": "release",
57-
"displayName": "Release Build",
58-
"inherits": [
59-
"root-config",
60-
"release-base-unix"
61-
]
62-
}
2+
"version": 9,
3+
"cmakeMinimumRequired": {
4+
"major": 3,
5+
"minor": 30,
6+
"patch": 0
7+
},
8+
"include": [
9+
"cmake/CMake${hostSystemName}Presets.json"
6310
],
6411
"buildPresets": [
6512
{

cmake/CMakeDarwinPresets.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"version": 6,
3+
"include": [
4+
"CMakeGenericPresets.json"
5+
],
6+
"configurePresets": [
7+
{
8+
"name": "debug-base-Darwin",
9+
"hidden": true,
10+
"cacheVariables": {
11+
"CMAKE_BUILD_TYPE": "Debug",
12+
"CMAKE_CXX_FLAGS": "-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined"
13+
},
14+
"condition": {
15+
"type": "equals",
16+
"lhs": "${hostSystemName}",
17+
"rhs": "Darwin"
18+
}
19+
},
20+
{
21+
"name": "release-base-Darwin",
22+
"hidden": true,
23+
"cacheVariables": {
24+
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
25+
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Wno-shadow -Wconversion -Wsign-conversion -Wcast-align -Wcast-qual -Woverloaded-virtual -Wformat=2 -Wno-error"
26+
},
27+
"condition": {
28+
"type": "equals",
29+
"lhs": "${hostSystemName}",
30+
"rhs": "Darwin"
31+
}
32+
},
33+
{
34+
"name": "debug",
35+
"displayName": "Debug Build",
36+
"inherits": [
37+
"root-config",
38+
"debug-base-Darwin"
39+
]
40+
},
41+
{
42+
"name": "release",
43+
"displayName": "Release Build",
44+
"inherits": [
45+
"root-config",
46+
"release-base-Darwin"
47+
]
48+
}
49+
]
50+
}

cmake/CMakeGenericPresets.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"version": 6,
3+
"configurePresets": [
4+
{
5+
"name": "root-config",
6+
"hidden": true,
7+
"generator": "Ninja",
8+
"binaryDir": "${sourceDir}/build/${presetName}",
9+
"installDir": "${sourceDir}/stagedir",
10+
"cacheVariables": {
11+
"CMAKE_PREFIX_PATH": {
12+
"type": "path",
13+
"value": "${sourceDir}/stagedir"
14+
},
15+
"CMAKE_CXX_EXTENSIONS": false,
16+
"CMAKE_CXX_STANDARD": "23",
17+
"CMAKE_CXX_STANDARD_REQUIRED": true,
18+
"CMAKE_EXPORT_COMPILE_COMMANDS": true
19+
}
20+
}
21+
]
22+
}

cmake/CMakeLinuxPresets.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"version": 6,
3+
"include": [
4+
"CMakeGenericPresets.json"
5+
],
6+
"configurePresets": [
7+
{
8+
"name": "debug-base-Linux",
9+
"hidden": true,
10+
"cacheVariables": {
11+
"CMAKE_BUILD_TYPE": "Debug",
12+
"CMAKE_CXX_FLAGS": "-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=leak -fsanitize=undefined"
13+
},
14+
"condition": {
15+
"type": "notEquals",
16+
"lhs": "${hostSystemName}",
17+
"rhs": "Windows"
18+
}
19+
},
20+
{
21+
"name": "release-base-Linux",
22+
"hidden": true,
23+
"cacheVariables": {
24+
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
25+
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Wno-shadow -Wconversion -Wsign-conversion -Wcast-align -Wcast-qual -Woverloaded-virtual -Wformat=2 -Wno-error"
26+
},
27+
"condition": {
28+
"type": "notEquals",
29+
"lhs": "${hostSystemName}",
30+
"rhs": "Windows"
31+
}
32+
},
33+
{
34+
"name": "debug",
35+
"displayName": "Debug Build",
36+
"inherits": [
37+
"root-config",
38+
"debug-base-Linux"
39+
]
40+
},
41+
{
42+
"name": "release",
43+
"displayName": "Release Build",
44+
"inherits": [
45+
"root-config",
46+
"release-base-Linux"
47+
]
48+
}
49+
]
50+
}

0 commit comments

Comments
 (0)