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

This commit is contained in:
Tomas Rezucha
2022-03-17 13:10:29 +01:00
parent c29343eb94
commit 161eaeed25

View File

@ -1,3 +1,15 @@
idf_component_register(SRCS "cdc_acm_host.c" set(srcs)
INCLUDE_DIRS "include" set(include)
REQUIRES usb) # 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}
)