diff --git a/firmware/esp32-csi-node/main/CMakeLists.txt b/firmware/esp32-csi-node/main/CMakeLists.txt index 38c4c4074..2a2b21cb6 100644 --- a/firmware/esp32-csi-node/main/CMakeLists.txt +++ b/firmware/esp32-csi-node/main/CMakeLists.txt @@ -23,7 +23,6 @@ set(SRCS # ESP-IDF v6+: headers must resolve via explicit REQUIRES (no implicit deps). set(REQUIRES - json esp_wifi esp_netif esp_event @@ -59,6 +58,15 @@ if(IDF_VERSION_MAJOR GREATER_EQUAL 6) list(APPEND REQUIRES esp_driver_tsens) endif() +# cJSON (config_api.c) ships as the bundled `json` component up to ESP-IDF 5.x +# and was moved OUT to the component manager in v6, where requiring `json` +# fails outright: "Failed to resolve component 'json' required by component +# 'main': unknown name." Declaring it unconditionally broke the v6.0.2 lane +# while the 5.4 lane stayed green -- one toolchain is not the build matrix. +if(IDF_VERSION_MAJOR LESS 6) + list(APPEND REQUIRES json) +endif() + # ADR-061: Mock CSI generator for QEMU testing + ADR-081 mock radio binding if(CONFIG_CSI_MOCK_ENABLED) list(APPEND SRCS "mock_csi.c" "rv_radio_ops_mock.c") diff --git a/firmware/esp32-csi-node/main/idf_component.yml b/firmware/esp32-csi-node/main/idf_component.yml index 4ec1d552a..af4a7bcc4 100644 --- a/firmware/esp32-csi-node/main/idf_component.yml +++ b/firmware/esp32-csi-node/main/idf_component.yml @@ -11,3 +11,14 @@ dependencies: ## Onboard WS2812 LED Disabling espressif/led_strip: "^3.0.0" + + ## cJSON for config_api.c. + ## Bundled as the `json` component up to ESP-IDF 5.x and moved out to the + ## component manager in v6, so it is pulled ONLY on the v6+ lane -- on 5.4 + ## `main/CMakeLists.txt` requires the built-in `json` instead. Taking it from + ## the registry on 5.x as well would mean two cJSON implementations in one + ## build. + espressif/cjson: + version: "^1.7.19" + rules: + - if: "idf_version >=6.0"