Trim the build components Closes IDF-7459 See merge request espressif/esp-idf!24143
@@ -1,6 +1,9 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)
+# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
+set(COMPONENTS main)
+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(test_ana_cmpr)
@@ -8,4 +8,5 @@ endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS "."
+ PRIV_REQUIRES unity driver
WHOLE_ARCHIVE)
project(dac_test)
# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
# the component can be registered as WHOLE_ARCHIVE
+ PRIV_REQUIRES unity driver esp_adc
project(dac_legacy_test)
@@ -4,4 +4,5 @@ set(srcs "test_app_main.c"
+ PRIV_REQUIRES unity driver esp_event esp_adc
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
+ * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -13,9 +13,7 @@
#include "unity_test_utils.h"
#include "esp_system.h"
#include "esp_event.h"
-#include "esp_wifi.h"
#include "esp_log.h"
-#include "nvs_flash.h"
#include "soc/soc_caps.h"
#define CONFIG_ADC_SUPPRESS_DEPRECATE_WARN 1
#include "driver/adc.h"
project(gpio_test)
@@ -12,4 +12,5 @@ endif()
+ PRIV_REQUIRES unity driver spi_flash
project(gpio_extension_test)
@@ -19,4 +19,5 @@ endif()
project(gptimer_test)
set(EXTRA_COMPONENT_DIRS
"$ENV{IDF_PATH}/tools/unit-test-app/components"
)
@@ -3,4 +3,5 @@ set(srcs "test_app_main.c"
+ PRIV_REQUIRES unity driver test_utils
project(i2s_test)
"test_i2s_iram.c")
@@ -2,6 +2,9 @@
# in this exact order for cmake to work correctly
@@ -1,4 +1,5 @@
idf_component_register(SRCS "test_app_main.c" "test_i2s_tdm_full_duplex.c"
WHOLE_ARCHIVE
@@ -1,5 +1,8 @@
project(i2s_adc_dac_test)
"test_i2s_dac.c")
@@ -18,9 +18,7 @@
#include "unity.h"
#include "esp_rom_sys.h"
@@ -16,9 +16,7 @@
#include "test_dac_audio_file.h"
#include "driver/i2s.h"
#include "driver/dac.h"
project(i2s_legacy_test)
@@ -2,4 +2,5 @@ set(srcs "test_app_main.c"
"test_legacy_i2s.c")
project(ledc_test)
+ PRIV_REQUIRES unity driver esp_timer
project(legacy_adc_driver_test)
"test_legacy_adc.c")
project(legacy_mcpwm_driver_test)
project(legacy_pcnt_driver_test)
project(legacy_rmt_test)
"test_legacy_rmt.c")
+ PRIV_REQUIRES unity driver infrared_tools
project(legacy_rtc_temp_driver_test)
project(legacy_timer_driver_test)
project(mcpwm_test)
@@ -15,4 +15,5 @@ endif()
project(parlio_test)
project(pcnt_test)
@@ -9,4 +9,5 @@ endif()
project(rmt_test)
@@ -9,4 +9,5 @@ if(CONFIG_RMT_ISR_IRAM_SAFE)
endif()
idf_component_register(SRCS "${srcs}"
set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components")
"$ENV{IDF_PATH}/components/driver/test_apps/components"
project(test_temperature_sensor)
project(touch_sensor_v1_test)
@@ -1,3 +1,4 @@
idf_component_register(SRCS "test_app_main.c" "test_touch_v1.c"
project(touch_sensor_v2_test)
idf_component_register(SRCS "test_app_main.c" "test_touch_v2.c" "touch_scope.c"
project(twai_test)
@@ -5,4 +5,5 @@ set(srcs "test_app_main.c"
@@ -3,6 +3,9 @@ cmake_minimum_required(VERSION 3.16)
project(adc_test)
@@ -9,4 +9,5 @@ set(srcs "test_app_main.c"
+ PRIV_REQUIRES driver esp_wifi nvs_flash esp_adc test_utils