From 312261785ca6d938b924eb8e47eeff01214c7819 Mon Sep 17 00:00:00 2001 From: Erhan Kurubas Date: Tue, 19 Aug 2025 09:53:33 +0300 Subject: [PATCH] change(examples): enable minimal build for gcov --- examples/system/gcov/CMakeLists.txt | 2 ++ examples/system/gcov/main/CMakeLists.txt | 3 ++- examples/system/gcov/sdkconfig.defaults | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/system/gcov/CMakeLists.txt b/examples/system/gcov/CMakeLists.txt index 9f13094314..86e9ff2539 100644 --- a/examples/system/gcov/CMakeLists.txt +++ b/examples/system/gcov/CMakeLists.txt @@ -8,6 +8,8 @@ cmake_minimum_required(VERSION 3.16) file(TO_NATIVE_PATH "$ENV{IDF_PATH}/tools/cmake/project.cmake" _project_path) include(${_project_path}) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +idf_build_set_property(MINIMAL_BUILD ON) project(gcov_example) file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/coverage_report" _coverage_path) diff --git a/examples/system/gcov/main/CMakeLists.txt b/examples/system/gcov/main/CMakeLists.txt index e2548349ac..338953e328 100644 --- a/examples/system/gcov/main/CMakeLists.txt +++ b/examples/system/gcov/main/CMakeLists.txt @@ -1,6 +1,7 @@ idf_component_register(SRCS "gcov_example_main.c" "gcov_example_func.c" - INCLUDE_DIRS ".") + INCLUDE_DIRS "." + PRIV_REQUIRES "sample" "esp_driver_gpio") set_source_files_properties(gcov_example_main.c gcov_example_func.c diff --git a/examples/system/gcov/sdkconfig.defaults b/examples/system/gcov/sdkconfig.defaults index bdb2055bf8..b144d1fbf2 100644 --- a/examples/system/gcov/sdkconfig.defaults +++ b/examples/system/gcov/sdkconfig.defaults @@ -4,3 +4,5 @@ CONFIG_APPTRACE_ENABLE=y CONFIG_APPTRACE_LOCK_ENABLE=y CONFIG_APPTRACE_ONPANIC_HOST_FLUSH_TMO=-1 CONFIG_APPTRACE_POSTMORTEM_FLUSH_THRESH=0 + +CONFIG_ESP_GCOV_ENABLE=y