diff --git a/components/app_trace/CMakeLists.txt b/components/app_trace/CMakeLists.txt index 866ba9f72d..353b3dc14c 100644 --- a/components/app_trace/CMakeLists.txt +++ b/components/app_trace/CMakeLists.txt @@ -121,16 +121,3 @@ if(CONFIG_APPTRACE_GCOV_ENABLE) else() target_link_libraries(${COMPONENT_LIB} INTERFACE $ c) endif() - -# This function adds a dependency on the given component if the component is included into the build. -function(maybe_add_component component_name) - idf_build_get_property(components BUILD_COMPONENTS) - if(${component_name} IN_LIST components) - idf_component_get_property(lib_name ${component_name} COMPONENT_LIB) - target_link_libraries(${COMPONENT_LIB} PUBLIC ${lib_name}) - endif() -endfunction() - -if(CONFIG_APPTRACE_DEST_UART0 OR CONFIG_APPTRACE_DEST_UART1 OR CONFIG_APPTRACE_DEST_UART2) - maybe_add_component(driver) -endif() diff --git a/components/esp_adc/CMakeLists.txt b/components/esp_adc/CMakeLists.txt index 92a4d9304a..bf0f1330c2 100644 --- a/components/esp_adc/CMakeLists.txt +++ b/components/esp_adc/CMakeLists.txt @@ -51,7 +51,18 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/deprecated/${target}/esp_adc_cal_legacy.c list(APPEND srcs "deprecated/${target}/esp_adc_cal_legacy.c") endif() +set(extra_requires) +idf_build_get_property(target IDF_TARGET) +if(${target} STREQUAL "esp32") + list(APPEND extra_requires esp_driver_i2s) +endif() +if(${target} STREQUAL "esp32s2") + list(APPEND extra_requires esp_driver_spi) +endif() + +list(APPEND extra_requires driver) # esp_adc depends on "driver/adc_types_legacy.h" + idf_component_register(SRCS ${srcs} INCLUDE_DIRS ${includes} - PRIV_REQUIRES driver esp_driver_gpio efuse esp_pm esp_ringbuf esp_mm + PRIV_REQUIRES esp_driver_gpio efuse esp_pm esp_ringbuf esp_mm ${extra_requires} LDFRAGMENTS linker.lf) diff --git a/components/esp_coex/CMakeLists.txt b/components/esp_coex/CMakeLists.txt index e2ef279e36..e6f8699772 100644 --- a/components/esp_coex/CMakeLists.txt +++ b/components/esp_coex/CMakeLists.txt @@ -27,7 +27,7 @@ endif() idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "include" - PRIV_REQUIRES esp_timer driver esp_event + PRIV_REQUIRES esp_timer esp_driver_gpio LDFRAGMENTS "${ldfragments}") if(CONFIG_ESP_COEX_ENABLED) diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index d7bec39ef5..7acb639a7d 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -53,10 +53,9 @@ if(CONFIG_ESP_PHY_ENABLED) endif() endif() -# [refactor-todo]: requires "driver" component for periph_ctrl header file idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "include" "${idf_target}/include" - PRIV_REQUIRES nvs_flash driver efuse esp_timer esp_wifi + PRIV_REQUIRES nvs_flash esp_driver_gpio efuse esp_timer esp_wifi LDFRAGMENTS "${ldfragments}" EMBED_FILES ${embed_files} ) diff --git a/components/esp_psram/CMakeLists.txt b/components/esp_psram/CMakeLists.txt index 9a599bcb25..d787750bd2 100644 --- a/components/esp_psram/CMakeLists.txt +++ b/components/esp_psram/CMakeLists.txt @@ -8,9 +8,7 @@ set(includes "include") set(priv_requires heap spi_flash esp_mm) if(${target} STREQUAL "esp32") - list(APPEND priv_requires bootloader_support) - # [refactor-todo]: requires "driver" for `spicommon_periph_claim` - list(APPEND priv_requires driver) + list(APPEND priv_requires bootloader_support esp_driver_spi esp_driver_gpio) endif() set(srcs) diff --git a/components/esp_wifi/CMakeLists.txt b/components/esp_wifi/CMakeLists.txt index 9f0c5106cc..48755eba67 100644 --- a/components/esp_wifi/CMakeLists.txt +++ b/components/esp_wifi/CMakeLists.txt @@ -14,13 +14,6 @@ if(CONFIG_ESP_WIFI_ENABLED OR CONFIG_ESP_HOST_WIFI_ENABLED) set(ldfragments "linker.lf") endif() - if(IDF_TARGET_ESP32) - # dport workaround headers are in esp32 component - set(extra_priv_requires esp32) - else() - set(extra_priv_requires) - endif() - set(srcs "src/lib_printf.c" "src/mesh_event.c" @@ -57,8 +50,8 @@ idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "include" "wifi_apps/include" "wifi_apps/nan_app/include" ${local_include_dirs} REQUIRES esp_event esp_phy esp_netif - PRIV_REQUIRES driver esptool_py esp_pm esp_timer nvs_flash - wpa_supplicant hal lwip esp_coex ${extra_priv_requires} + PRIV_REQUIRES esptool_py esp_pm esp_timer nvs_flash + wpa_supplicant hal lwip esp_coex PRIV_INCLUDE_DIRS ../wpa_supplicant/src/ ../wpa_supplicant/esp_supplicant/src/ wifi_apps/roaming_app/include LDFRAGMENTS "${ldfragments}") diff --git a/components/espcoredump/CMakeLists.txt b/components/espcoredump/CMakeLists.txt index d4d0686c7f..cc4cd78977 100644 --- a/components/espcoredump/CMakeLists.txt +++ b/components/espcoredump/CMakeLists.txt @@ -34,8 +34,6 @@ idf_component_register(SRCS ${srcs} LDFRAGMENTS linker.lf PRIV_REQUIRES esp_partition spi_flash bootloader_support mbedtls esp_rom soc esp_system esp_driver_gpio - # [refactor-todo] esp_flash_internal.h -> spi_common_internal.h requires cleanup - driver ) # make sure 'core_dump_init' object file is considered by the linker diff --git a/components/ieee802154/CMakeLists.txt b/components/ieee802154/CMakeLists.txt index e3e98bac2b..901db1b534 100644 --- a/components/ieee802154/CMakeLists.txt +++ b/components/ieee802154/CMakeLists.txt @@ -35,5 +35,5 @@ idf_component_register( INCLUDE_DIRS "${include}" PRIV_INCLUDE_DIRS "${private_include}" LDFRAGMENTS linker.lf - PRIV_REQUIRES esp_phy driver esp_timer esp_coex soc hal + PRIV_REQUIRES esp_phy esp_timer esp_coex soc hal esp_pm ) diff --git a/components/protocomm/CMakeLists.txt b/components/protocomm/CMakeLists.txt index ea02be326c..fd099e15eb 100644 --- a/components/protocomm/CMakeLists.txt +++ b/components/protocomm/CMakeLists.txt @@ -54,5 +54,5 @@ endif() idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "${include_dirs}" PRIV_INCLUDE_DIRS "${priv_include_dirs}" - PRIV_REQUIRES protobuf-c mbedtls console esp_http_server driver + PRIV_REQUIRES protobuf-c mbedtls console esp_http_server esp_driver_uart REQUIRES bt) diff --git a/components/touch_element/CMakeLists.txt b/components/touch_element/CMakeLists.txt index 21c0e7f171..f9b13c5f08 100644 --- a/components/touch_element/CMakeLists.txt +++ b/components/touch_element/CMakeLists.txt @@ -6,12 +6,12 @@ endif() set(TOUCH_ELEMENT_COMPATIBLE_TARGETS "esp32s2" "esp32s3") -if(IDF_TARGET IN_LIST TOUCH_ELEMENT_COMPATIBLE_TARGETS) +if(${target} IN_LIST TOUCH_ELEMENT_COMPATIBLE_TARGETS) idf_component_register(SRCS "touch_element.c" "touch_button.c" "touch_slider.c" "touch_matrix.c" INCLUDE_DIRS include - REQUIRES driver + REQUIRES driver # touch_element uses legacy "driver/touch_sensor.h" PRIV_REQUIRES esp_timer) endif() diff --git a/examples/bluetooth/nimble/common/nimble_peripheral_utils/CMakeLists.txt b/examples/bluetooth/nimble/common/nimble_peripheral_utils/CMakeLists.txt index 963f158e7f..b7d75ef0d0 100644 --- a/examples/bluetooth/nimble/common/nimble_peripheral_utils/CMakeLists.txt +++ b/examples/bluetooth/nimble/common/nimble_peripheral_utils/CMakeLists.txt @@ -1,3 +1,3 @@ idf_component_register(SRCS "misc.c" "scli.c" INCLUDE_DIRS "." - PRIV_REQUIRES bt console driver) + PRIV_REQUIRES bt console esp_driver_uart) diff --git a/examples/bluetooth/nimble/throughput_app/blecent_throughput/components/cmd_system/CMakeLists.txt b/examples/bluetooth/nimble/throughput_app/blecent_throughput/components/cmd_system/CMakeLists.txt index 81198d6511..51629b348d 100644 --- a/examples/bluetooth/nimble/throughput_app/blecent_throughput/components/cmd_system/CMakeLists.txt +++ b/examples/bluetooth/nimble/throughput_app/blecent_throughput/components/cmd_system/CMakeLists.txt @@ -1,4 +1,4 @@ idf_component_register(SRCS "cmd_system.c" INCLUDE_DIRS "." - PRIV_REQUIRES driver + PRIV_REQUIRES esp_driver_uart esp_driver_gpio REQUIRES console spi_flash) diff --git a/examples/common_components/protocol_examples_common/CMakeLists.txt b/examples/common_components/protocol_examples_common/CMakeLists.txt index d8bccb1e99..1af6081ddf 100644 --- a/examples/common_components/protocol_examples_common/CMakeLists.txt +++ b/examples/common_components/protocol_examples_common/CMakeLists.txt @@ -29,7 +29,7 @@ endif() idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "include" - PRIV_REQUIRES esp_netif driver esp_wifi vfs console esp_eth) + PRIV_REQUIRES esp_netif esp_driver_gpio esp_driver_uart esp_wifi vfs console esp_eth) if(CONFIG_EXAMPLE_PROVIDE_WIFI_CONSOLE_CMD) idf_component_optional_requires(PRIVATE console) diff --git a/examples/peripherals/dedicated_gpio/soft_i2c/components/soft_i2c_master/CMakeLists.txt b/examples/peripherals/dedicated_gpio/soft_i2c/components/soft_i2c_master/CMakeLists.txt index e4f8f6e109..527d4a9ffb 100644 --- a/examples/peripherals/dedicated_gpio/soft_i2c/components/soft_i2c_master/CMakeLists.txt +++ b/examples/peripherals/dedicated_gpio/soft_i2c/components/soft_i2c_master/CMakeLists.txt @@ -1,4 +1,4 @@ idf_component_register(SRCS "soft_i2c_master.c" INCLUDE_DIRS "include" - PRIV_REQUIRES driver + PRIV_REQUIRES esp_driver_gpio LDFRAGMENTS linker.lf) diff --git a/examples/peripherals/dedicated_gpio/soft_i2c/main/CMakeLists.txt b/examples/peripherals/dedicated_gpio/soft_i2c/main/CMakeLists.txt index fad7163a29..a890722e7d 100644 --- a/examples/peripherals/dedicated_gpio/soft_i2c/main/CMakeLists.txt +++ b/examples/peripherals/dedicated_gpio/soft_i2c/main/CMakeLists.txt @@ -2,4 +2,4 @@ set(srcs "soft_i2c_master_main.c") idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "." - PRIV_REQUIRES driver soft_i2c_master) + PRIV_REQUIRES soft_i2c_master) diff --git a/examples/peripherals/dedicated_gpio/soft_spi/components/soft_spi/CMakeLists.txt b/examples/peripherals/dedicated_gpio/soft_spi/components/soft_spi/CMakeLists.txt index f8f04fbb20..52206b9e9f 100644 --- a/examples/peripherals/dedicated_gpio/soft_spi/components/soft_spi/CMakeLists.txt +++ b/examples/peripherals/dedicated_gpio/soft_spi/components/soft_spi/CMakeLists.txt @@ -9,5 +9,5 @@ endif() idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "include" - PRIV_REQUIRES driver + PRIV_REQUIRES esp_driver_gpio LDFRAGMENTS linker.lf) diff --git a/examples/peripherals/dedicated_gpio/soft_uart/components/soft_uart/CMakeLists.txt b/examples/peripherals/dedicated_gpio/soft_uart/components/soft_uart/CMakeLists.txt index fd3f255d48..283e6ebce8 100644 --- a/examples/peripherals/dedicated_gpio/soft_uart/components/soft_uart/CMakeLists.txt +++ b/examples/peripherals/dedicated_gpio/soft_uart/components/soft_uart/CMakeLists.txt @@ -15,5 +15,5 @@ endif() idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "include" - PRIV_REQUIRES driver + PRIV_REQUIRES esp_driver_gpio LDFRAGMENTS linker.lf) diff --git a/examples/peripherals/dedicated_gpio/soft_uart/main/CMakeLists.txt b/examples/peripherals/dedicated_gpio/soft_uart/main/CMakeLists.txt index d7f337faff..c4b9c9acfe 100644 --- a/examples/peripherals/dedicated_gpio/soft_uart/main/CMakeLists.txt +++ b/examples/peripherals/dedicated_gpio/soft_uart/main/CMakeLists.txt @@ -2,4 +2,4 @@ set(srcs "soft_uart_main.c") idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "." - PRIV_REQUIRES driver soft_uart) + PRIV_REQUIRES soft_uart) diff --git a/examples/peripherals/gpio/matrix_keyboard/components/matrix_keyboard/CMakeLists.txt b/examples/peripherals/gpio/matrix_keyboard/components/matrix_keyboard/CMakeLists.txt index 167e6b2d80..869cc7bc2e 100644 --- a/examples/peripherals/gpio/matrix_keyboard/components/matrix_keyboard/CMakeLists.txt +++ b/examples/peripherals/gpio/matrix_keyboard/components/matrix_keyboard/CMakeLists.txt @@ -3,5 +3,5 @@ set(component_srcs "src/matrix_keyboard.c") idf_component_register(SRCS "${component_srcs}" INCLUDE_DIRS "include" PRIV_INCLUDE_DIRS "" - PRIV_REQUIRES "driver" + PRIV_REQUIRES "esp_driver_gpio" REQUIRES "") diff --git a/examples/peripherals/i2c/i2c_eeprom/components/i2c_eeprom/CMakeLists.txt b/examples/peripherals/i2c/i2c_eeprom/components/i2c_eeprom/CMakeLists.txt index e079d1bc99..4f34834f98 100644 --- a/examples/peripherals/i2c/i2c_eeprom/components/i2c_eeprom/CMakeLists.txt +++ b/examples/peripherals/i2c/i2c_eeprom/components/i2c_eeprom/CMakeLists.txt @@ -1,3 +1,3 @@ idf_component_register(SRCS "i2c_eeprom.c" INCLUDE_DIRS "." - PRIV_REQUIRES driver) + PRIV_REQUIRES esp_driver_i2c) diff --git a/examples/peripherals/mcpwm/mcpwm_foc_svpwm_open_loop/main/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_foc_svpwm_open_loop/main/CMakeLists.txt index 2cb3a1d20b..6062058ff0 100644 --- a/examples/peripherals/mcpwm/mcpwm_foc_svpwm_open_loop/main/CMakeLists.txt +++ b/examples/peripherals/mcpwm/mcpwm_foc_svpwm_open_loop/main/CMakeLists.txt @@ -1,5 +1,5 @@ idf_component_register( SRCS app_main.c svpwm/esp_svpwm.c foc/esp_foc.c INCLUDE_DIRS "svpwm" "foc" - REQUIRES driver + PRIV_REQUIRES esp_driver_mcpwm esp_driver_gpio ) diff --git a/examples/peripherals/spi_master/hd_eeprom/components/eeprom/CMakeLists.txt b/examples/peripherals/spi_master/hd_eeprom/components/eeprom/CMakeLists.txt index 5dc1ae18f9..8f0e80cc7a 100644 --- a/examples/peripherals/spi_master/hd_eeprom/components/eeprom/CMakeLists.txt +++ b/examples/peripherals/spi_master/hd_eeprom/components/eeprom/CMakeLists.txt @@ -1,4 +1,5 @@ idf_component_register(SRCS "spi_eeprom.c" LDFRAGMENTS "linker.lf" INCLUDE_DIRS "." - PRIV_REQUIRES driver) + PRIV_REQUIRES esp_driver_gpio + REQUIRES esp_driver_spi) diff --git a/examples/storage/fatfs/ext_flash/CMakeLists.txt b/examples/storage/fatfs/ext_flash/CMakeLists.txt index 66233663cd..04aa9b31b6 100644 --- a/examples/storage/fatfs/ext_flash/CMakeLists.txt +++ b/examples/storage/fatfs/ext_flash/CMakeLists.txt @@ -2,6 +2,5 @@ # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) -# external SPI flash driver not currently supported for ESP32-S2 include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(fatfs_ext_flash) diff --git a/examples/system/console/advanced/components/cmd_system/CMakeLists.txt b/examples/system/console/advanced/components/cmd_system/CMakeLists.txt index e8cc0f05aa..ff01df1e98 100644 --- a/examples/system/console/advanced/components/cmd_system/CMakeLists.txt +++ b/examples/system/console/advanced/components/cmd_system/CMakeLists.txt @@ -1,6 +1,6 @@ idf_component_register(SRCS "cmd_system.c" "cmd_system_common.c" INCLUDE_DIRS . - REQUIRES console spi_flash driver esp_driver_gpio) + REQUIRES console spi_flash esp_driver_uart esp_driver_gpio) if(CONFIG_SOC_DEEP_SLEEP_SUPPORTED OR CONFIG_SOC_LIGHT_SLEEP_SUPPORTED) target_sources(${COMPONENT_LIB} PRIVATE cmd_system_sleep.c) diff --git a/examples/system/ulp/ulp_fsm/ulp/main/CMakeLists.txt b/examples/system/ulp/ulp_fsm/ulp/main/CMakeLists.txt index a75dc6afb0..e6e0dd26e0 100644 --- a/examples/system/ulp/ulp_fsm/ulp/main/CMakeLists.txt +++ b/examples/system/ulp/ulp_fsm/ulp/main/CMakeLists.txt @@ -1,6 +1,6 @@ idf_component_register(SRCS "ulp_example_main.c" INCLUDE_DIRS "" - REQUIRES driver soc nvs_flash ulp) + REQUIRES esp_driver_gpio soc nvs_flash ulp) # # ULP support additions to component CMakeLists.txt. # diff --git a/examples/system/ulp/ulp_fsm/ulp_adc/main/CMakeLists.txt b/examples/system/ulp/ulp_fsm/ulp_adc/main/CMakeLists.txt index b5768ee1a9..c53cee29d4 100644 --- a/examples/system/ulp/ulp_fsm/ulp_adc/main/CMakeLists.txt +++ b/examples/system/ulp/ulp_fsm/ulp_adc/main/CMakeLists.txt @@ -1,6 +1,6 @@ idf_component_register(SRCS "ulp_adc_example_main.c" INCLUDE_DIRS "" - REQUIRES soc nvs_flash ulp driver esp_adc) + REQUIRES soc nvs_flash ulp esp_driver_gpio esp_adc) # # ULP support additions to component CMakeLists.txt. # diff --git a/examples/system/ulp/ulp_riscv/ds18b20_onewire/main/CMakeLists.txt b/examples/system/ulp/ulp_riscv/ds18b20_onewire/main/CMakeLists.txt index 1e806d7596..142e703864 100644 --- a/examples/system/ulp/ulp_riscv/ds18b20_onewire/main/CMakeLists.txt +++ b/examples/system/ulp/ulp_riscv/ds18b20_onewire/main/CMakeLists.txt @@ -1,7 +1,7 @@ # Set usual component variables set(COMPONENT_SRCS "ulp_riscv_ds18b20_example_main.c") set(COMPONENT_ADD_INCLUDEDIRS "") -set(COMPONENT_REQUIRES soc nvs_flash ulp driver) +set(COMPONENT_REQUIRES soc nvs_flash ulp esp_driver_gpio) register_component() diff --git a/examples/system/ulp/ulp_riscv/gpio/main/CMakeLists.txt b/examples/system/ulp/ulp_riscv/gpio/main/CMakeLists.txt index 0bf0513382..6364f96194 100644 --- a/examples/system/ulp/ulp_riscv/gpio/main/CMakeLists.txt +++ b/examples/system/ulp/ulp_riscv/gpio/main/CMakeLists.txt @@ -1,7 +1,7 @@ # Set usual component variables set(COMPONENT_SRCS "ulp_riscv_example_main.c") set(COMPONENT_ADD_INCLUDEDIRS "") -set(COMPONENT_REQUIRES soc nvs_flash ulp driver) +set(COMPONENT_REQUIRES soc nvs_flash ulp esp_driver_gpio) register_component() diff --git a/examples/system/ulp/ulp_riscv/gpio_interrupt/main/CMakeLists.txt b/examples/system/ulp/ulp_riscv/gpio_interrupt/main/CMakeLists.txt index 67e0ac6ca2..56eed6afde 100644 --- a/examples/system/ulp/ulp_riscv/gpio_interrupt/main/CMakeLists.txt +++ b/examples/system/ulp/ulp_riscv/gpio_interrupt/main/CMakeLists.txt @@ -1,7 +1,7 @@ # Set usual component variables set(COMPONENT_SRCS "ulp_riscv_gpio_intr_example_main.c") set(COMPONENT_ADD_INCLUDEDIRS "") -set(COMPONENT_REQUIRES ulp driver) +set(COMPONENT_REQUIRES ulp esp_driver_gpio) register_component() diff --git a/examples/system/ulp/ulp_riscv/uart_print/main/CMakeLists.txt b/examples/system/ulp/ulp_riscv/uart_print/main/CMakeLists.txt index 0bf0513382..2b9f99c8ef 100644 --- a/examples/system/ulp/ulp_riscv/uart_print/main/CMakeLists.txt +++ b/examples/system/ulp/ulp_riscv/uart_print/main/CMakeLists.txt @@ -1,7 +1,7 @@ # Set usual component variables set(COMPONENT_SRCS "ulp_riscv_example_main.c") set(COMPONENT_ADD_INCLUDEDIRS "") -set(COMPONENT_REQUIRES soc nvs_flash ulp driver) +set(COMPONENT_REQUIRES soc nvs_flash ulp) register_component()