From 42d03d5e7ebe1d2243be81ea7145a9ce016771bf Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Fri, 26 Jul 2024 11:46:22 +0530 Subject: [PATCH] [ESP32] Fix compiling examples with insights (#34472) --- config/esp32/components/chip/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index d0c1fc4463f442..f27b29baf91ff9 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -472,7 +472,15 @@ if (CONFIG_SEC_CERT_DAC_PROVIDER) endif() if (CONFIG_ENABLE_ESP_INSIGHTS_TRACE) - idf_component_get_property(esp_insights_lib espressif__esp_insights COMPONENT_LIB) + idf_build_get_property(build_components BUILD_COMPONENTS) + # esp_insights can be used as an independent component or through component manager so, + # We should check and add the right component. + if("espressif__esp_insights" IN_LIST build_components) + idf_component_get_property(esp_insights_lib espressif__esp_insights COMPONENT_LIB) + elseif("esp_insights" IN_LIST build_components) + idf_component_get_property(esp_insights_lib esp_insights COMPONENT_LIB) + endif() + list(APPEND chip_libraries $) endif()