refactor: remove unnecessary driver dependencies from build rules

This commit is contained in:
morris
2025-10-09 11:48:17 +08:00
parent 3a0eba4c46
commit cd41b6a640
17 changed files with 47 additions and 27 deletions
+1 -2
View File
@@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <string.h>
#include "soc/soc.h"
#include "esp_log.h"
#include "esp_cpu.h"
@@ -11,8 +12,6 @@
#include "driver/uart.h"
#include "hal/uart_ll.h"
#include "string.h"
#include "driver/gpio.h"
#define APP_TRACE_MAX_TX_BUFF_UART CONFIG_APPTRACE_UART_TX_BUFF_SIZE
#define APP_TRACE_MAX_TX_MSG_UART CONFIG_APPTRACE_UART_TX_MSG_SIZE
@@ -5,8 +5,9 @@ components/app_trace/test_apps:
- app_trace
- esp_timer
- soc
- driver
- esp_hw_support
- esp_driver_uart
- esp_driver_gptimer
disable:
- if: IDF_TARGET in ["esp32c5", "esp32c61", "esp32h21", "esp32h4"]
temporary: true
@@ -5,5 +5,5 @@ set(srcs "test_app_main.cpp"
# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
# the component can be registered as WHOLE_ARCHIVE
idf_component_register(SRCS ${srcs}
PRIV_REQUIRES unity driver esp_driver_gpio esp_hw_support
PRIV_REQUIRES unity driver esp_hw_support
WHOLE_ARCHIVE)
+1 -1
View File
@@ -10,7 +10,7 @@
#include "esp_types.h"
#include "esp_intr_alloc.h"
#include "esp_err.h"
#include "driver/gpio.h"
#include "hal/gpio_types.h"
#include "hal/twai_types.h"
#ifdef __cplusplus
@@ -9,9 +9,19 @@ project(gptimer_test)
idf_build_get_property(elf EXECUTABLE)
if(CONFIG_COMPILER_DUMP_RTL_FILES)
# Collect RTL directories in a variable for readability. Join them
# with commas so they are passed as a single --rtl-dirs argument to the script.
set(GPTIMER_RTL_DIRS
${CMAKE_BINARY_DIR}/esp-idf/esp_driver_gptimer
${CMAKE_BINARY_DIR}/esp-idf/hal
${CMAKE_BINARY_DIR}/esp-idf/esp_hal_timg
)
string(JOIN "," GPTIMER_RTL_DIRS_JOINED ${GPTIMER_RTL_DIRS})
add_custom_target(check_test_app_sections ALL
COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py
--rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_gptimer/,${CMAKE_BINARY_DIR}/esp-idf/hal/
COMMAND ${PYTHON}
$ENV{IDF_PATH}/tools/ci/check_callgraph.py
--rtl-dirs ${GPTIMER_RTL_DIRS_JOINED}
--elf-file ${CMAKE_BINARY_DIR}/gptimer_test.elf
find-refs
--from-sections=.iram0.text
@@ -13,9 +13,18 @@ project(i2c_test)
idf_build_get_property(elf EXECUTABLE)
if(CONFIG_COMPILER_DUMP_RTL_FILES)
# Collect RTL directories in a variable for readability. Join them
# with commas so they are passed as a single --rtl-dirs argument to the script.
set(I2C_RTL_DIRS
${CMAKE_BINARY_DIR}/esp-idf/esp_driver_i2c
${CMAKE_BINARY_DIR}/esp-idf/hal
${CMAKE_BINARY_DIR}/esp-idf/esp_hal_i2c
)
string(JOIN "," I2C_RTL_DIRS_JOINED ${I2C_RTL_DIRS})
add_custom_target(check_test_app_sections ALL
COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py
--rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_i2c/,${CMAKE_BINARY_DIR}/esp-idf/hal/
--rtl-dirs ${I2C_RTL_DIRS_JOINED}
--elf-file ${CMAKE_BINARY_DIR}/i2c_test.elf
find-refs
--from-sections=.iram0.text
@@ -4,10 +4,5 @@ cmake_minimum_required(VERSION 3.22)
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)
set(EXTRA_COMPONENT_DIRS
"$ENV{IDF_PATH}/tools/test_apps/components"
"$ENV{IDF_PATH}/components/driver/test_apps/components"
)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(host_sdmmc)
@@ -3,3 +3,5 @@ dependencies:
espressif/esp_serial_slave_link: "^1.1.0"
test_driver_utils:
path: ${IDF_PATH}/components/driver/test_apps/components/test_driver_utils
test_utils:
path: ${IDF_PATH}/tools/test_apps/components/test_utils
@@ -4,11 +4,6 @@ cmake_minimum_required(VERSION 3.22)
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)
set(EXTRA_COMPONENT_DIRS
"$ENV{IDF_PATH}/tools/test_apps/components"
"$ENV{IDF_PATH}/components/driver/test_apps/components"
)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(sdio)
@@ -0,0 +1,5 @@
dependencies:
test_driver_utils:
path: ${IDF_PATH}/components/driver/test_apps/components/test_driver_utils
test_utils:
path: ${IDF_PATH}/tools/test_apps/components/test_utils
@@ -10,9 +10,17 @@ project(mspi_test)
idf_build_get_property(elf EXECUTABLE)
if(CONFIG_COMPILER_DUMP_RTL_FILES)
# Collect RTL directories in a variable for readability. Join them
# with commas so they are passed as a single --rtl-dirs argument to the script.
set(MSPI_RTL_DIRS
# ${CMAKE_BINARY_DIR}/esp-idf/spi_flash # IDF-14271
${CMAKE_BINARY_DIR}/esp-idf/hal
${CMAKE_BINARY_DIR}/esp-idf/esp_hal_mspi
)
string(JOIN "," MSPI_RTL_DIRS_JOINED ${MSPI_RTL_DIRS})
add_custom_target(check_test_app_sections ALL
COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py
--rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/
--rtl-dirs ${MSPI_RTL_DIRS_JOINED}
--elf-file ${CMAKE_BINARY_DIR}/mspi_test.elf
find-refs
--from-sections=.iram0.text
@@ -14,4 +14,3 @@ components/vfs/test_apps:
- fatfs
- spiffs
- console
- driver
+2 -3
View File
@@ -67,10 +67,10 @@ examples/bluetooth/bluedroid/classic_bt:
- esp_driver_gpio
- esp_driver_i2s
- esp_driver_uart
- esp_driver_dac
depends_components-:
- mbedtls
depends_filepatterns:
- components/driver/dac/**/*
- examples/bluetooth/bluedroid/esp_hid_host/**/*
- examples/bluetooth/bluedroid/classic_bt/pytest_classic_bt_test.py
- examples/bluetooth/bluedroid/classic_bt/bt_discovery/pytest_classic_bt_discovery_test.py
@@ -83,8 +83,7 @@ examples/bluetooth/bluedroid/coex/a2dp_gatts_coex:
reason: the other targets are not tested yet
depends_components+:
- esp_driver_i2s
depends_filepatterns:
- components/driver/dac/**/*
- esp_driver_dac
examples/bluetooth/blufi:
<<: *bt_default_depends
-1
View File
@@ -3,7 +3,6 @@
examples/storage/custom_flash_driver:
depends_components:
- spi_flash
- driver
examples/storage/emmc:
depends_components:
+1 -1
View File
@@ -13,7 +13,7 @@ examples/storage/fatfs/ext_flash:
- fatfs
- vfs
- spi_flash
- driver
- esp_driver_spi
disable:
- if: IDF_TARGET in ["esp32p4", "esp32c5", "esp32c61", "esp32h21", "esp32h4"]
temporary: true
@@ -20,7 +20,6 @@ examples/storage/nvs/nvs_console:
examples/storage/nvs/nvs_rw_blob:
depends_components:
- nvs_flash
- driver
disable_test:
- if: IDF_TARGET not in ["esp32", "esp32c3"]
reason: only one target per arch needed
+1 -1
View File
@@ -12,7 +12,7 @@ tools/test_apps/phy/phy_tsens:
- if: (SOC_WIFI_SUPPORTED != 1 or SOC_TEMP_SENSOR_SUPPORTED != 1) or SOC_LIGHT_SLEEP_SUPPORTED != 1
depends_components:
- hal
- driver
- esp_phy
- esp_hw_support
- esp_wifi
- esp_driver_tsens