Skip to content

Commit 5c3a562

Browse files
committed
Merge branch 'chor/clean_driver_dependency_in_build_system' into 'master'
refactor: remove unnecessary driver dependencies from build rules Closes IDF-10696 See merge request espressif/esp-idf!42405
2 parents e11789a + cd41b6a commit 5c3a562

File tree

17 files changed

+47
-27
lines changed

17 files changed

+47
-27
lines changed

components/app_trace/port/port_uart.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include <string.h>
78
#include "soc/soc.h"
89
#include "esp_log.h"
910
#include "esp_cpu.h"
1011
#include "esp_app_trace_port.h"
1112

1213
#include "driver/uart.h"
1314
#include "hal/uart_ll.h"
14-
#include "string.h"
15-
#include "driver/gpio.h"
1615

1716
#define APP_TRACE_MAX_TX_BUFF_UART CONFIG_APPTRACE_UART_TX_BUFF_SIZE
1817
#define APP_TRACE_MAX_TX_MSG_UART CONFIG_APPTRACE_UART_TX_MSG_SIZE

components/app_trace/test_apps/.build-test-rules.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ components/app_trace/test_apps:
55
- app_trace
66
- esp_timer
77
- soc
8-
- driver
98
- esp_hw_support
9+
- esp_driver_uart
10+
- esp_driver_gptimer
1011
disable:
1112
- if: IDF_TARGET in ["esp32c5", "esp32c61", "esp32h21", "esp32h4"]
1213
temporary: true

components/driver/test_apps/legacy_twai/main/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ set(srcs "test_app_main.cpp"
55
# In order for the cases defined by `TEST_CASE` to be linked into the final elf,
66
# the component can be registered as WHOLE_ARCHIVE
77
idf_component_register(SRCS ${srcs}
8-
PRIV_REQUIRES unity driver esp_driver_gpio esp_hw_support
8+
PRIV_REQUIRES unity driver esp_hw_support
99
WHOLE_ARCHIVE)

components/driver/twai/include/driver/twai.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "esp_types.h"
1111
#include "esp_intr_alloc.h"
1212
#include "esp_err.h"
13-
#include "driver/gpio.h"
13+
#include "hal/gpio_types.h"
1414
#include "hal/twai_types.h"
1515

1616
#ifdef __cplusplus

components/esp_driver_gptimer/test_apps/gptimer/CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,19 @@ project(gptimer_test)
99

1010
idf_build_get_property(elf EXECUTABLE)
1111
if(CONFIG_COMPILER_DUMP_RTL_FILES)
12+
# Collect RTL directories in a variable for readability. Join them
13+
# with commas so they are passed as a single --rtl-dirs argument to the script.
14+
set(GPTIMER_RTL_DIRS
15+
${CMAKE_BINARY_DIR}/esp-idf/esp_driver_gptimer
16+
${CMAKE_BINARY_DIR}/esp-idf/hal
17+
${CMAKE_BINARY_DIR}/esp-idf/esp_hal_timg
18+
)
19+
string(JOIN "," GPTIMER_RTL_DIRS_JOINED ${GPTIMER_RTL_DIRS})
20+
1221
add_custom_target(check_test_app_sections ALL
13-
COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py
14-
--rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_gptimer/,${CMAKE_BINARY_DIR}/esp-idf/hal/
22+
COMMAND ${PYTHON}
23+
$ENV{IDF_PATH}/tools/ci/check_callgraph.py
24+
--rtl-dirs ${GPTIMER_RTL_DIRS_JOINED}
1525
--elf-file ${CMAKE_BINARY_DIR}/gptimer_test.elf
1626
find-refs
1727
--from-sections=.iram0.text

components/esp_driver_i2c/test_apps/i2c_test_apps/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,18 @@ project(i2c_test)
1313

1414
idf_build_get_property(elf EXECUTABLE)
1515
if(CONFIG_COMPILER_DUMP_RTL_FILES)
16+
# Collect RTL directories in a variable for readability. Join them
17+
# with commas so they are passed as a single --rtl-dirs argument to the script.
18+
set(I2C_RTL_DIRS
19+
${CMAKE_BINARY_DIR}/esp-idf/esp_driver_i2c
20+
${CMAKE_BINARY_DIR}/esp-idf/hal
21+
${CMAKE_BINARY_DIR}/esp-idf/esp_hal_i2c
22+
)
23+
string(JOIN "," I2C_RTL_DIRS_JOINED ${I2C_RTL_DIRS})
24+
1625
add_custom_target(check_test_app_sections ALL
1726
COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py
18-
--rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_i2c/,${CMAKE_BINARY_DIR}/esp-idf/hal/
27+
--rtl-dirs ${I2C_RTL_DIRS_JOINED}
1928
--elf-file ${CMAKE_BINARY_DIR}/i2c_test.elf
2029
find-refs
2130
--from-sections=.iram0.text

components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,5 @@ cmake_minimum_required(VERSION 3.22)
44
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
55
set(COMPONENTS main)
66

7-
set(EXTRA_COMPONENT_DIRS
8-
"$ENV{IDF_PATH}/tools/test_apps/components"
9-
"$ENV{IDF_PATH}/components/driver/test_apps/components"
10-
)
11-
127
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
138
project(host_sdmmc)

components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/host_sdmmc/main/idf_component.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ dependencies:
33
espressif/esp_serial_slave_link: "^1.1.0"
44
test_driver_utils:
55
path: ${IDF_PATH}/components/driver/test_apps/components/test_driver_utils
6+
test_utils:
7+
path: ${IDF_PATH}/tools/test_apps/components/test_utils

components/esp_driver_sdio/test_apps/sdio/sdio_common_tests/sdio/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ cmake_minimum_required(VERSION 3.22)
44
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
55
set(COMPONENTS main)
66

7-
set(EXTRA_COMPONENT_DIRS
8-
"$ENV{IDF_PATH}/tools/test_apps/components"
9-
"$ENV{IDF_PATH}/components/driver/test_apps/components"
10-
)
11-
127
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
138
project(sdio)
149

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dependencies:
2+
test_driver_utils:
3+
path: ${IDF_PATH}/components/driver/test_apps/components/test_driver_utils
4+
test_utils:
5+
path: ${IDF_PATH}/tools/test_apps/components/test_utils

0 commit comments

Comments
 (0)