summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2025-02-09 18:40:30 +0100
committerHiFiPhile <[email protected]>2025-02-09 18:40:30 +0100
commit1208f88b6ecc899bfac908aaf90a8be0997efb5d (patch)
tree993650d6a33aeeb382c7a433f0596f67b654917c /tools
parent09bce3532c9279b54f5dc1e48c51959344df6c56 (diff)
Sort list (bettter for Clion)
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/gen_presets.py70
1 files changed, 41 insertions, 29 deletions
diff --git a/tools/gen_presets.py b/tools/gen_presets.py
index 98b1a7d46..7542cfdf5 100755
--- a/tools/gen_presets.py
+++ b/tools/gen_presets.py
@@ -24,46 +24,57 @@ def main():
{"name": "default",
"hidden": True,
"description": r"Configure preset for the ${presetName} board",
- "generator": "Ninja",
+ "generator": "Ninja Multi-Config",
"binaryDir": r"${sourceDir}/build/${presetName}",
"cacheVariables": {
- "CMAKE_BUILD_TYPE": "RelWithDebInfo",
+ "CMAKE_DEFAULT_BUILD_TYPE": "RelWithDebInfo",
"BOARD": r"${presetName}"
- }
- }]
+ }}]
presets['configurePresets'].extend(
- [{'name': board, 'inherits': 'default'} for board in board_list]
+ sorted(
+ [
+ {
+ 'name': board,
+ 'inherits': 'default'
+ }
+ for board in board_list
+ ], key=lambda x: x['name']
+ )
)
# Build presets
# no inheritance since 'name' doesn't support macro expansion
- presets['buildPresets'] = [
- {
- 'name': board,
- 'description': "Build preset for the " + board + " board",
- 'configurePreset': board
- }
- for board in board_list
- ]
+ presets['buildPresets'] = sorted(
+ [
+ {
+ 'name': board,
+ 'description': "Build preset for the " + board + " board",
+ 'configurePreset': board
+ }
+ for board in board_list
+ ], key=lambda x: x['name']
+ )
# Workflow presets
- presets['workflowPresets'] = [
- {
- "name": board,
- "steps": [
- {
- "type": "configure",
- "name": board
- },
- {
- "type": "build",
- "name": board
- }
- ]
- }
- for board in board_list
- ]
+ presets['workflowPresets'] = sorted(
+ [
+ {
+ "name": board,
+ "steps": [
+ {
+ "type": "configure",
+ "name": board
+ },
+ {
+ "type": "build",
+ "name": board
+ }
+ ]
+ }
+ for board in board_list
+ ], key=lambda x: x['name']
+ )
with open("hw/bsp/BoardPresets.json", "w") as f:
f.write('{}\n'.format(json.dumps(presets, indent=2)))
@@ -87,5 +98,6 @@ def main():
print('Generating presets for the following examples:')
print(example_list)
+
if __name__ == "__main__":
main()