Skip to content

Commit 51019b4

Browse files
committed
Merge branch 'refactor/update_driver_dependency' into 'master'
refactor: Update driver dependency See merge request espressif/esp-serial-flasher!164
2 parents 386f984 + 610873b commit 51019b4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,23 @@ if (DEFINED ESP_PLATFORM)
116116
)
117117
endif()
118118

119+
set(priv_requires "esp_timer")
120+
121+
122+
# Starting from esp-idf v5.3, the GPIO, UART, SDMMC and SPI drivers are moved to separate components
123+
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.3")
124+
list(APPEND priv_requires "esp_driver_gpio" "esp_driver_uart")
125+
set(public_requires "esp_driver_sdmmc" "esp_driver_spi")
126+
else()
127+
set(public_requires "driver" "sdmmc")
128+
endif()
129+
119130
# Register component to esp-idf build system
120131
idf_component_register(SRCS ${srcs}
121132
INCLUDE_DIRS include port
122133
PRIV_INCLUDE_DIRS private_include
123-
PRIV_REQUIRES driver esp_timer sdmmc)
134+
PRIV_REQUIRES ${priv_requires}
135+
REQUIRES ${public_requires})
124136

125137
if (${CONFIG_SERIAL_FLASHER_INTERFACE_USB})
126138
idf_component_set_property(${COMPONENT_NAME} PRIV_REQUIRES usb APPEND)

0 commit comments

Comments
 (0)