Merge branch 'fix/backport/usb_host/cdc_build' into 'release/v4.4'

usb_host: Don't build CDC host driver for unsupported targets (backport v4.4)

See merge request espressif/esp-idf!17526
This commit is contained in:
Jiang Jiang Jian 2022-05-19 10:38:50 +08:00
commit 8fe41e2e41

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}
)