From bfaa3b6c4f9a0d64641155dc4e4f4e258a1f5eb5 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 8 Jun 2026 14:34:57 +0700 Subject: tools/gen_presets: build into cmake-build- with single-config Ninja Change the default configure preset binaryDir from build/ to cmake-build- (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//.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) --- hw/bsp/BoardPresets.json | 30 ++++++++++++++++++++++++++---- tools/gen_presets.py | 8 ++++---- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/hw/bsp/BoardPresets.json b/hw/bsp/BoardPresets.json index 86609d075..a700e7309 100644 --- a/hw/bsp/BoardPresets.json +++ b/hw/bsp/BoardPresets.json @@ -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": [ diff --git a/tools/gen_presets.py b/tools/gen_presets.py index 94a9361db..60404a5a7 100755 --- a/tools/gen_presets.py +++ b/tools/gen_presets.py @@ -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}" }}] -- cgit v1.3.1