Repository navigation
fix(build): hardware_defs target fails since hal.h includes generated headers - #7880
Merged
Merged
Conversation
… headers Since #7411, hal.h includes hal_settings.h (and some targets hal_pwm_sticks.h), which are generated into the radio/src binary dir. AddHardwareDefTarget() snapshots the directory's include paths before that dir is added, and its custom command didn't depend on the generated headers, so the preprocessor dump failed for every target and tools/generate-hw-defs.sh aborted on the first flavour. Add the binary dir to the include path and depend on the generated headers, as #7627 did for GenerateDatacopy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pfeerick
marked this pull request as ready for review
October 7, 2026 02:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
hardware_defstarget (the-E -dMpreprocessor dump of a target'shal.h, used bytools/generate-hw-defs.sh) fails for every target on main:Since #7411,
hal.hincludeshal_settings.h(and c14/horus/taranis also includehal_pwm_sticks.h). Both are generated into theradio/srcbinary dir.AddHardwareDefTarget()is called before that dir is added withinclude_directories(), so the include-path snapshot fromAddCompilerFlags()doesn't contain it. The custom command also didn't depend on the generated headers. CI doesn't build this target, buttools/generate-hw-def.shdoes, and this breakage was questioned in the PR but not responded to.Fix
In
AddHardwareDefTarget(), add-I${CMAKE_CURRENT_BINARY_DIR}and make the command depend onhal_settings.handhal_pwm_sticks.h. This is the same approach #7627 used forGenerateDatacopy.Testing
tools/generate-hw-defs.shwith the default flavour list: before, it failed on the first flavour (nv14); after, all 58 flavours succeed and produce a<flavour>.json.h.Main only: 2.12 doesn't have #7411.
🤖 Generated with Claude Code