Merge branch 'fix/usb_host/cdc_build' into 'master'

usb_host: Don't build CDC host driver for unsupported targets

See merge request espressif/esp-idf!17517
This commit is contained in:
Tomas Rezucha 2022-03-18 16:37:38 +08:00
commit f5f865df07
2 changed files with 16 additions and 3 deletions

View File

@ -167,6 +167,7 @@
/examples/network/ @esp-idf-codeowners/network @esp-idf-codeowners/wifi
/examples/openthread/ @esp-idf-codeowners/ieee802154
/examples/peripherals/ @esp-idf-codeowners/peripherals
/examples/peripherals/usb/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
/examples/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
/examples/provisioning/ @esp-idf-codeowners/app-utilities
/examples/security/ @esp-idf-codeowners/security

View File

@ -1,3 +1,15 @@
idf_component_register(SRCS "cdc_acm_host.c"
INCLUDE_DIRS "include"
REQUIRES usb)
set(srcs)
set(include)
# As CONFIG_USB_OTG_SUPPORTED comes from Kconfig, it is not evaluated yet
# when components are being registered.
set(require usb)
if(CONFIG_USB_OTG_SUPPORTED)
list(APPEND srcs "cdc_acm_host.c")
list(APPEND include "include")
endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS ${include}
REQUIRES ${require}
)