From 83bc1e2d827b16ada6cfb4a8bc2f46ea8562226a Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Mon, 16 Mar 2026 18:34:39 +0100 Subject: [PATCH] fix(build): move AddHardwareDefTarget after all add_definitions (#7185) Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com> --- radio/src/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 76e6de143..0b376f2ab 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -121,10 +121,6 @@ add_definitions( ) set(HW_DESC_JSON ${FLAVOUR}.json) -AddHardwareDefTarget(${HW_DESC_JSON}) - -# enable generating JSON definition separately for debugging -add_custom_target(hardware_defs DEPENDS ${HW_DESC_JSON}.h) include(hal/CMakeLists.txt) @@ -152,6 +148,11 @@ if(ARCH STREQUAL ARM) include(targets/common/arm/CMakeLists.txt) endif() +# Generate hardware definitions from hal.h +# Must be after all add_definitions() so the preprocessor sees all flags +AddHardwareDefTarget(${HW_DESC_JSON}) +add_custom_target(hardware_defs DEPENDS ${HW_DESC_JSON}.h) + include_directories(targets/${TARGET_DIR} ${THIRDPARTY_DIR}) if(NATIVE_BUILD)