Skip to content

Commit 612988a

Browse files
authored
chore: simplify presets (#434)
1 parent 485a08f commit 612988a

5 files changed

Lines changed: 47 additions & 80 deletions

File tree

AGENTS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
```
5959
- Preset prefixes:
6060
- `dev-`: incremental Debug builds
61-
- `pr-`: incremental RelWithDebInfo builds
6261
- `ci-`: clean RelWithDebInfo rebuilds
6362
- Common clean build commands:
6463
```bash

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ project(neolith
1616
)
1717
set(CMAKE_CXX_STANDARD 17)
1818
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
19+
set(CMAKE_POSITION_INDEPENDENT_CODE ON) # for shared libraries
1920
include(CTest) # calls enable_testing() if BUILD_TESTING is ON
2021
include(options) # defines options
2122

2223
if(MSVC)
2324
# Visual Studio 2019 or later
25+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
2426
add_compile_options(/W4 /wd4706 /permissive- /Zc:__cplusplus /EHs /utf-8 /nologo)
2527
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
2628
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")

CMakePresets.json

Lines changed: 41 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"binaryDir": "${sourceDir}/out/build/${presetName}",
1313
"cacheVariables": {
1414
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
15-
"CMAKE_POSITION_INDEPENDENT_CODE": "ON",
1615
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
1716
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "${sourceDir}/cmake/setup.cmake"
1817
}
@@ -21,8 +20,7 @@
2120
"name": "msvc-x64",
2221
"hidden": true,
2322
"cacheVariables": {
24-
"BISON_ROOT": "C:/GnuWin32",
25-
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL"
23+
"BISON_ROOT": "C:/GnuWin32"
2624
},
2725
"vendor": {
2826
"microsoft.com/VisualStudioSettings/CMake/1.0": {
@@ -32,15 +30,8 @@
3230
"enableClangTidyCodeAnalysis": true
3331
}
3432
},
35-
"architecture": {
36-
"value": "x64",
37-
"strategy": "set"
38-
},
39-
"condition": {
40-
"type": "equals",
41-
"lhs": "${hostSystemName}",
42-
"rhs": "Windows"
43-
}
33+
"architecture": { "value": "x64", "strategy": "set" },
34+
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows" }
4435
},
4536
{
4637
"name": "vs18-x64",
@@ -59,10 +50,7 @@
5950
"description": "Uses ClangCL compiler, x64 architecture",
6051
"inherits": ["project-default", "msvc-x64"],
6152
"generator": "Visual Studio 16 2019",
62-
"toolset": {
63-
"value": "ClangCL",
64-
"strategy": "set"
65-
}
53+
"toolset": { "value": "ClangCL", "strategy": "set" }
6654
},
6755
{
6856
"name": "linux-default",
@@ -73,11 +61,7 @@
7361
"hostOS": [ "Linux" ]
7462
}
7563
},
76-
"condition": {
77-
"type": "equals",
78-
"lhs": "${hostSystemName}",
79-
"rhs": "Linux"
80-
}
64+
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux" }
8165
},
8266
{
8367
"name": "linux-gcc",
@@ -101,11 +85,7 @@
10185
"name": "macos-default",
10286
"hidden": true,
10387
"generator": "Ninja Multi-Config",
104-
"condition": {
105-
"type": "equals",
106-
"lhs": "${hostSystemName}",
107-
"rhs": "Darwin"
108-
}
88+
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Darwin" }
10989
},
11090
{
11191
"name": "macos-arm64",
@@ -119,116 +99,92 @@
11999
"buildPresets": [
120100
{
121101
"name": "dev-vs18-x64",
102+
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows" },
122103
"description": "Debug Build (build modified files)",
123104
"configurePreset": "vs18-x64",
124105
"configuration": "Debug",
125106
"targets": ["ALL_BUILD"]
126107
},
127-
{
128-
"name": "pr-vs18-x64",
129-
"description": "Pull-Request Validation Build (build modified files)",
130-
"inherits": ["dev-vs18-x64"],
131-
"configuration": "RelWithDebInfo"
132-
},
133108
{
134109
"name": "ci-vs18-x64",
135110
"description": "Continous Integration Build (rebuild all)",
136-
"inherits": ["pr-vs18-x64"],
111+
"inherits": ["dev-vs18-x64"],
112+
"configuration": "RelWithDebInfo",
137113
"cleanFirst": true
138114
},
139115
{
140116
"name": "dev-vs16-x64",
117+
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows" },
141118
"description": "Debug Build (build modified files)",
142119
"configurePreset": "vs16-x64",
143120
"configuration": "Debug",
144121
"targets": ["ALL_BUILD"]
145122
},
146-
{
147-
"name": "pr-vs16-x64",
148-
"description": "Pull-Request Validation Build (build modified files)",
149-
"inherits": ["dev-vs16-x64"],
150-
"configuration": "RelWithDebInfo"
151-
},
152123
{
153124
"name": "ci-vs16-x64",
154125
"description": "Continous Integration Build (rebuild all)",
155-
"inherits": ["pr-vs16-x64"],
126+
"inherits": ["dev-vs16-x64"],
127+
"configuration": "RelWithDebInfo",
156128
"cleanFirst": true
157129
},
158130
{
159131
"name": "dev-clangcl-x64",
132+
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows" },
160133
"description": "Debug Build (build modified files)",
161134
"configurePreset": "clangcl-x64",
162135
"configuration": "Debug",
163136
"targets": ["ALL_BUILD"]
164137
},
165-
{
166-
"name": "pr-clangcl-x64",
167-
"description": "Pull-Request Validation Build (build modified files)",
168-
"inherits": ["dev-clangcl-x64"],
169-
"configuration": "RelWithDebInfo"
170-
},
171138
{
172139
"name": "ci-clangcl-x64",
173140
"description": "Continous Integration Build (rebuild all)",
174-
"inherits": ["pr-clangcl-x64"],
141+
"inherits": ["dev-clangcl-x64"],
142+
"configuration": "RelWithDebInfo",
175143
"cleanFirst": true
176144
},
177145
{
178146
"name": "dev-linux-gcc",
147+
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux" },
179148
"description": "Debug Build (build modified files)",
180149
"configurePreset": "linux-gcc",
181150
"configuration": "Debug",
182151
"targets": ["all"]
183152
},
184-
{
185-
"name": "pr-linux-gcc",
186-
"description": "Pull-Request Validation Build (build modified files)",
187-
"inherits": ["dev-linux-gcc"],
188-
"configuration": "RelWithDebInfo"
189-
},
190153
{
191154
"name": "ci-linux-gcc",
192155
"description": "Continous Integration Build (rebuild all)",
193-
"inherits": ["pr-linux-gcc"],
156+
"inherits": ["dev-linux-gcc"],
157+
"configuration": "RelWithDebInfo",
194158
"cleanFirst": true
195159
},
196160
{
197161
"name": "dev-linux-clang",
162+
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux" },
198163
"description": "Debug Build (build modified files)",
199164
"configurePreset": "linux-clang",
200165
"configuration": "Debug",
201166
"targets": ["all"]
202167
},
203-
{
204-
"name": "pr-linux-clang",
205-
"description": "Pull-Request Validation Build (build modified files)",
206-
"inherits": ["dev-linux-clang"],
207-
"configuration": "RelWithDebInfo"
208-
},
209168
{
210169
"name": "ci-linux-clang",
211170
"description": "Continous Integration Build (rebuild all)",
212-
"inherits": ["pr-linux-clang"],
171+
"inherits": ["dev-linux-clang"],
172+
"configuration": "RelWithDebInfo",
213173
"cleanFirst": true
214174
},
215175
{
216176
"name": "dev-macos-arm64",
177+
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Darwin" },
217178
"description": "Debug Build (build modified files)",
218179
"configurePreset": "macos-arm64",
219180
"configuration": "Debug",
220181
"targets": ["all"]
221182
},
222-
{
223-
"name": "pr-macos-arm64",
224-
"description": "Pull-Request Validation Build (build modified files)",
225-
"inherits": ["dev-macos-arm64"],
226-
"configuration": "RelWithDebInfo"
227-
},
228183
{
229184
"name": "ci-macos-arm64",
230185
"description": "Continuous Integration Build (rebuild all)",
231-
"inherits": ["pr-macos-arm64"],
186+
"inherits": ["dev-macos-arm64"],
187+
"configuration": "RelWithDebInfo",
232188
"cleanFirst": true
233189
}
234190
],
@@ -240,41 +196,52 @@
240196
"noTestsAction": "ignore"
241197
}
242198
},
199+
{
200+
"name": "ut-windows",
201+
"hidden": true,
202+
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows" }
203+
},
243204
{
244205
"name": "ut-vs18-x64",
245206
"description": "Run unit-tests for Windows 64-bits architecture",
246207
"configurePreset": "vs18-x64",
247-
"inherits": ["ut-defaults"]
208+
"inherits": ["ut-defaults", "ut-windows"]
248209
},
249210
{
250211
"name": "ut-vs16-x64",
251212
"description": "Run unit-tests for Windows 64-bits architecture",
252213
"configurePreset": "vs16-x64",
253-
"inherits": ["ut-defaults"]
214+
"inherits": ["ut-defaults", "ut-windows"]
254215
},
255216
{
256217
"name": "ut-clangcl-x64",
257218
"description": "Run unit-tests for Windows 64-bits architecture",
258219
"configurePreset": "clangcl-x64",
259-
"inherits": ["ut-defaults"]
220+
"inherits": ["ut-defaults", "ut-windows"]
221+
},
222+
{
223+
"name": "ut-linux",
224+
"hidden": true,
225+
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux" }
260226
},
261227
{
262228
"name": "ut-linux-gcc",
263229
"description": "Run unit-tests on Linux",
264230
"configurePreset": "linux-gcc",
265-
"inherits": ["ut-defaults"]
231+
"inherits": ["ut-defaults", "ut-linux"]
266232
},
267233
{
268234
"name": "ut-linux-clang",
269235
"description": "Run unit-tests on Linux",
270236
"configurePreset": "linux-clang",
271-
"inherits": ["ut-defaults"]
237+
"inherits": ["ut-defaults", "ut-linux"]
272238
},
273239
{
274240
"name": "ut-macos-arm64",
275241
"description": "Run unit-tests on macOS ARM64",
276242
"configurePreset": "macos-arm64",
277-
"inherits": ["ut-defaults"]
243+
"inherits": ["ut-defaults"],
244+
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Darwin" }
278245
}
279246
]
280247
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ cd examples
6666
/path/to/neolith -f m3.conf -c
6767
~~~
6868

69-
For automated testing, first build Neolith with `pr-*` or `ci-*` preset, and run (requires [hatch](https://pypi.org/project/hatch/)):
69+
For automated testing, first build Neolith with `ci-*` preset, and run (requires [hatch](https://pypi.org/project/hatch/)):
7070
~~~sh
7171
# Run automated testbots against M3 mudlib using locally built LPMud driver
7272
cd examples/m3_testbots

docs/INSTALL.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,13 @@ For Linux `RelWithDebInfo`, the executable is typically at `out/build/linux/src/
210210
Preset|Configuration|Targets|Description
211211
---|---|---|---
212212
`dev-linux`|Debug|`all`|Incremental development build.
213-
`pr-linux`|RelWithDebInfo|`all`|Incremental validation build.
214213
`ci-linux`|RelWithDebInfo|`all`|Clean rebuild (`cleanFirst=true`) for CI-style checks.
215214

216215
Windows and ClangCL equivalents:
217216

218-
- `dev-vs16-x64`, `pr-vs16-x64`, `ci-vs16-x64`
219-
- `dev-clang-x64`, `pr-clang-x64`, `ci-clang-x64`
220-
- `dev-vs16-win32`, `pr-vs16-win32`, `ci-vs16-win32`
217+
- `dev-vs16-x64`, `ci-vs16-x64`
218+
- `dev-clang-x64`, `ci-clang-x64`
219+
- `dev-vs16-win32`, `ci-vs16-win32`
221220

222221
### Running Unit Tests
223222

0 commit comments

Comments
 (0)