diff --git a/tools/test_apps/system/g0_components/CMakeLists.txt b/tools/test_apps/system/g0_components/CMakeLists.txt index fe3c8847f1b..8b22859e738 100644 --- a/tools/test_apps/system/g0_components/CMakeLists.txt +++ b/tools/test_apps/system/g0_components/CMakeLists.txt @@ -36,13 +36,21 @@ idf_build_set_property(__BUILD_COMPONENT_DEPGRAPH_ENABLED 1) project(g0_components) -if(CONFIG_IDF_TARGET_ESP32P4) - idf_build_set_property(C_COMPILE_OPTIONS "-DCONFIG_ESP_REV_MIN_FULL=300" APPEND) -endif() +# CONFIG_ESP_REV_MIN_FULL and CONFIG_XTAL_FREQ live in esp_common's Kconfig, +# which is outside the G0 closure. When that Kconfig is not loaded the +# symbols are absent from sdkconfig.h and the G0 sources need them on the +# command line. When every component's Kconfig is processed (IDF_BUILD_V2) +# the symbols are already defined via their Kconfig defaults; injecting +# them again would conflict, so skip the injection. +if(NOT IDF_BUILD_V2) + if(CONFIG_IDF_TARGET_ESP32P4) + idf_build_set_property(C_COMPILE_OPTIONS "-DCONFIG_ESP_REV_MIN_FULL=300" APPEND) + endif() -if(CONFIG_IDF_TARGET_ESP32C2) - # clk_tree hal-driver needs CONFIG_XTAL_FREQ - idf_build_set_property(C_COMPILE_OPTIONS "-DCONFIG_XTAL_FREQ=26" APPEND) + if(CONFIG_IDF_TARGET_ESP32C2) + # clk_tree hal-driver needs CONFIG_XTAL_FREQ + idf_build_set_property(C_COMPILE_OPTIONS "-DCONFIG_XTAL_FREQ=26" APPEND) + endif() endif() # Currently, only support a single core on Xtensa targets.