tools/gen_presets: build into cmake-build-<board> with single-config Ninja

Change the default configure preset binaryDir from build/<board> to
cmake-build-<board> (the dir name HIL expects) and switch the generator
from Ninja Multi-Config to single-config Ninja. Multi-Config nests
binaries under a RelWithDebInfo/ subdir, which hil_test.py does not look
in; single-config emits device/<ex>/<ex>.elf so preset-built firmware is
directly consumable by `hil_test.py -B examples`.

Regenerated BoardPresets.json (also picks up the tracked ch32v103c_bluepill
board that was missing from presets).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
hathach
2026-06-08 14:34:57 +07:00
parent 97480bad2c
commit bfaa3b6c4f
2 changed files with 30 additions and 8 deletions

View File

@ -5,10 +5,10 @@
"name": "default",
"hidden": true,
"description": "Configure preset for the ${presetName} board",
"generator": "Ninja Multi-Config",
"binaryDir": "${sourceDir}/build/${presetName}",
"generator": "Ninja",
"binaryDir": "${sourceDir}/cmake-build-${presetName}",
"cacheVariables": {
"CMAKE_DEFAULT_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"BOARD": "${presetName}"
}
},
@ -17,7 +17,7 @@
"hidden": true,
"description": "Configure preset for the ${presetName} board",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"binaryDir": "${sourceDir}/cmake-build-${presetName}",
"cacheVariables": {
"BOARD": "${presetName}"
}
@ -122,6 +122,10 @@
"name": "ch32f205r-r0",
"inherits": "default"
},
{
"name": "ch32v103c_bluepill",
"inherits": "default"
},
{
"name": "ch32v103r_r1_1v0",
"inherits": "default"
@ -1087,6 +1091,11 @@
"description": "Build preset for the ch32f205r-r0 board",
"configurePreset": "ch32f205r-r0"
},
{
"name": "ch32v103c_bluepill",
"description": "Build preset for the ch32v103c_bluepill board",
"configurePreset": "ch32v103c_bluepill"
},
{
"name": "ch32v103r_r1_1v0",
"description": "Build preset for the ch32v103r_r1_1v0 board",
@ -2472,6 +2481,19 @@
}
]
},
{
"name": "ch32v103c_bluepill",
"steps": [
{
"type": "configure",
"name": "ch32v103c_bluepill"
},
{
"type": "build",
"name": "ch32v103c_bluepill"
}
]
},
{
"name": "ch32v103r_r1_1v0",
"steps": [

View File

@ -31,17 +31,17 @@ def main():
{"name": "default",
"hidden": True,
"description": r"Configure preset for the ${presetName} board",
"generator": "Ninja Multi-Config",
"binaryDir": r"${sourceDir}/build/${presetName}",
"generator": "Ninja",
"binaryDir": r"${sourceDir}/cmake-build-${presetName}",
"cacheVariables": {
"CMAKE_DEFAULT_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"BOARD": r"${presetName}"
}},
{"name": "default single config",
"hidden": True,
"description": r"Configure preset for the ${presetName} board",
"generator": "Ninja",
"binaryDir": r"${sourceDir}/build/${presetName}",
"binaryDir": r"${sourceDir}/cmake-build-${presetName}",
"cacheVariables": {
"BOARD": r"${presetName}"
}}]