Skip to content

Commit 8e2b2fe

Browse files
Jordan Yatescarlescufi
authored andcommitted
serial: CONFIG_USB_CDC_ACM adds file to library
It is possible to use the UART abstraction for USB communications without any of the dedicated UART drivers being enabled. This currently causes a compilation error because CMake throws an error if a library has no sources. The empty file forces there to be at least one file in the library when `CONFIG_USB_CDC_ACM` is enabled. Removing `select CONFIG_SERIAL_HAS_DRIVER` from `CONFIG_USB_CDC_ACM` is not a valid solution as this symbol is required by `CONFIG_UART_CONSOLE` and therefore `USB_UART_CONSOLE`. Fixes #31067. Signed-off-by: Jordan Yates <[email protected]>
1 parent 91715af commit 8e2b2fe

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/serial/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ zephyr_library_sources_ifdef(CONFIG_UART_XLNX_UARTLITE uart_xlnx_uartlite.c)
3636
zephyr_library_sources_ifdef(CONFIG_UART_XMC4XXX uart_xmc4xxx.c)
3737
zephyr_library_sources_ifdef(CONFIG_UART_NPCX uart_npcx.c)
3838
zephyr_library_sources_ifdef(CONFIG_UART_APBUART uart_apbuart.c)
39+
zephyr_library_sources_ifdef(CONFIG_USB_CDC_ACM ${ZEPHYR_BASE}/misc/empty_file.c)
3940

4041
zephyr_library_sources_ifdef(CONFIG_USERSPACE uart_handlers.c)
4142

0 commit comments

Comments
 (0)