cmake: Fix usb include directory organization

There are two problems with how zephyr/subsys/usb is being added to
the include path. Firstly it is using the zephyr_library_ API to
modify the zephyr library, when the zephyr_ API should have been used.

Secondly the code is located in the class directory even though it
affects the more general usb directory.

This patch fixes these issues. Using zephyr_library_ in this instance
works by accident when 'zephyr' is the current library but has not
guarantees of working in the future.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2019-10-01 15:05:05 +02:00 committed by Carles Cufí
commit 9d0e2cb325
2 changed files with 2 additions and 2 deletions

View file

@ -1,6 +1,8 @@
# SPDX-License-Identifier: Apache-2.0
if(CONFIG_USB_DEVICE_STACK)
zephyr_include_directories(${ZEPHYR_BASE}/subsys/usb)
zephyr_sources(
usb_device.c
usb_descriptor.c

View file

@ -1,7 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_library_include_directories(${ZEPHYR_BASE}/subsys/usb)
zephyr_sources_ifdef(CONFIG_USB_CDC_ACM cdc_acm.c)
zephyr_sources_ifdef(CONFIG_USB_MASS_STORAGE mass_storage.c)
zephyr_sources_ifdef(CONFIG_USB_DEVICE_BLUETOOTH bluetooth.c)