zephyr/subsys/usb/CMakeLists.txt
Sebastian Bøe 9d0e2cb325 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>
2019-10-01 19:22:02 +02:00

40 lines
772 B
CMake

# 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
)
add_subdirectory(class)
endif()
if(CONFIG_USB_DEVICE_BOS)
zephyr_sources(
bos.c
)
endif()
if(CONFIG_USB_DEVICE_OS_DESC)
zephyr_sources(
os_desc.c
)
endif()
if(CONFIG_USB_DEVICE_VID EQUAL 0x2FE3)
message(WARNING
"CONFIG_USB_DEVICE_VID has default value 0x2FE3.
This value is only for testing and MUST be configured for USB products."
)
if(CONFIG_USB_DEVICE_PID EQUAL 0x100)
message(WARNING
"CONFIG_USB_DEVICE_PID has default value 0x100.
This value is only for testing and MUST be configured for USB products."
)
endif()
endif()