Skip to content

fix(build): hardware_defs target fails since hal.h includes generated headers - #7880

Merged
pfeerick merged 1 commit into
mainfrom
fix/hardware-defs-target
Oct 7, 2026
Merged

pfeerick merged 1 commit into
mainfrom
fix/hardware-defs-target

Conversation

@pfeerick

@pfeerick pfeerick commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Summary

The hardware_defs target (the -E -dM preprocessor dump of a target's hal.h, used by tools/generate-hw-defs.sh) fails for every target on main:

radio/src/targets/horus/hal.h:24:10: fatal error: hal_settings.h: No such file or directory

Since #7411, hal.h includes hal_settings.h (and c14/horus/taranis also include hal_pwm_sticks.h). Both are generated into the radio/src binary dir. AddHardwareDefTarget() is called before that dir is added with include_directories(), so the include-path snapshot from AddCompilerFlags() doesn't contain it. The custom command also didn't depend on the generated headers. CI doesn't build this target, but tools/generate-hw-def.sh does, 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 on hal_settings.h and hal_pwm_sticks.h. This is the same approach #7627 used for GenerateDatacopy.

Testing

  • tools/generate-hw-defs.sh with 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

… 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 pfeerick added bug 🪲 Something isn't working compilation Related to compiling the firmware and firmware options bug/regression ↩️ A new version of EdgeTX broke something and removed bug 🪲 Something isn't working labels Oct 7, 2026
@pfeerick pfeerick added this to the 3.0 milestone Oct 7, 2026
@pfeerick
pfeerick marked this pull request as ready for review October 7, 2026 02:36
@pfeerick
pfeerick merged commit c048c8f into main Oct 7, 2026
38 checks passed
@pfeerick
pfeerick deleted the fix/hardware-defs-target branch October 7, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug/regression ↩️ A new version of EdgeTX broke something compilation Related to compiling the firmware and firmware options

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant