Skip to content

How to integrate with Zephyr when in a module #52229

Answered by nylnx
nylnx asked this question in Q&A
Discussion options

You must be logged in to vote

By researching these functions I actually found zephyr_library_amend() (which is used instead of zephyr_library()) and actually lets you add out-of-tree CMake sources as long as the module has the same directory structure as the Zephyr tree. So if I put my UART driver into my_module/drivers/serial/my_uart.c and have a CMakeLists.txt use zephyr_library_amend() and zephyr_library_sources(my_uart.c) it just works and eliminates the CMake warning :)

For Kconfig there seems to be no way (as far as I can tell) to enable this behavior. But I found that it probably would be possible to add a custom preprocessor command, which expands to potential module Kconfigs... You just would have to expand t…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by nylnx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants