From c8fc4d226a9920a518330046923dd69ddc3a0d4a Mon Sep 17 00:00:00 2001 From: Tomas Rezucha Date: Thu, 17 Mar 2022 13:10:29 +0100 Subject: [PATCH 1/2] usb_host: Don't build CDC host driver for unsupported targets --- .../cdc/common/cdc_acm_host/CMakeLists.txt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/examples/peripherals/usb/host/cdc/common/cdc_acm_host/CMakeLists.txt b/examples/peripherals/usb/host/cdc/common/cdc_acm_host/CMakeLists.txt index 39bec48e25..f2ff73f8fc 100644 --- a/examples/peripherals/usb/host/cdc/common/cdc_acm_host/CMakeLists.txt +++ b/examples/peripherals/usb/host/cdc/common/cdc_acm_host/CMakeLists.txt @@ -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} + ) From 68395c36179306c44b8478668517b3670c9a0905 Mon Sep 17 00:00:00 2001 From: Tomas Rezucha Date: Thu, 17 Mar 2022 15:26:57 +0100 Subject: [PATCH 2/2] usb: Codeowners for /examples/peripherals/usb/ --- .gitlab/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS index 1e9eb6a421..8bf0d10c27 100644 --- a/.gitlab/CODEOWNERS +++ b/.gitlab/CODEOWNERS @@ -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