out-of-tree serial driver get No SOURCES warning #71734
-
out-of-tree driver, add a new serial driver, get warning as this: Excluding target from build. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Try using |
Beta Was this translation helpful? Give feedback.
-
@gramsay0 Thanks for your reply, I try to use zephyr_library_amend() rather than zephyr_library() in out-of-tree cmake, but a compilation error occurred:
and the previous 'No SOURCES given' alarm still exists.
The directory structure of my driver is as follows:
In drivers/serial/atcuart100/CMakeLists.txt, the code is as follows:
I need your help to solve this problem. |
Beta Was this translation helpful? Give feedback.
Try using
zephyr_library_amend()
rather thanzephyr_library()
in out-of-tree cmake.This amends the Zephyr
drivers__serial
library with your out-of-tree additions, rather than creating a new library.Otherwise one of the two libraries will likely be empty and raise that warning.
https://github.com/zephyrproject-rtos/zephyr/blob/main/cmake/modules/extensions.cmake#L461