-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: cmake: fixes some No SOURCES given to Zephyr library:
warnings
#37774
drivers: cmake: fixes some No SOURCES given to Zephyr library:
warnings
#37774
Conversation
When there is no console driver enabled, cmake warns that the library has no sources. So only include the console directory when CONFIG_CONSOLE is enabled. Signed-off-by: Daniel Leung <[email protected]>
When there is no sensor driver enabled, cmake warns that the library has no sources. Fix that by wrapping cmake library instructions inside kconfig. Fixes zephyrproject-rtos#37765 Signed-off-by: Daniel Leung <[email protected]>
6071f38
to
d0c285f
Compare
bool | ||
help | ||
Hidden option to indicate if any Grove sensors are enabled. | ||
|
||
config GROVE_LIGHT_SENSOR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use an if GROVE_SENSORS
block instead of select
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was trying to avoid breaking builds as they would have to enable CONFIG_GROVE_SENSORS
separately. But this would be better in the long run. So changed the hidden kconfig to a visible one, and all other Grove sensor kconfig are grouped under this new one.
When there is no grove sensor driver enabled, cmake warns that the library has no sources. Fix that by adding a new kconfig to be used by CMake to selectively include the grove directory. Signed-off-by: Daniel Leung <[email protected]>
d0c285f
to
4653002
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes the sensor and console errors, the interrupt controller still has this issue though, at least for nRF52:
https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/interrupt_controller/CMakeLists.txt
I'm not sure what a nice solution looks like there, as a giant if(X OR Y or Z)
chain isn't great.
The solution from #31068 could be reused there actually, just add the empty file to the sources. |
That doesn't seem like a solution we really should be going with. We should either decided to remove the warning or fix up Kconfig's. |
@dcpleung we still have this issue regarding net and ethernet drivers on esp32 build: No SOURCES given to Zephyr library: drivers__net
Excluding target from build.
CMake Warning at ../../../../CMakeLists.txt:718 (message):
No SOURCES given to Zephyr library: drivers__ethernet
Excluding target from build. Is there anything we can do on esp side or it needs a new PR following this one? |
This is probably caused by having |
Hi, ESP32 requires those configs to enable L2 layer. Considering it does not use the available drivers, any recommendation? |
Hm... can try adding something like this zephyr/drivers/serial/CMakeLists.txt Line 43 in 698a286
|
This fixes some of the
No SOURCES given to Zephyr library:
warnings after merging #37512. This is caused byzephyr_library()
call without any source files being included in the library.Note that some of the warnings are caused by enabling a driver type but none of the drivers, for example,
CONFIG_PINMUX=y
but no pinmux drivers enabled. This is simply configuration errors.