-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
CMake libraries overview and content in IDE #8825
Comments
The changes to strip --whole-archive in #8451 also solves the issue of stray files as fewer and more source specific libraries are used. |
Several driver libraries uses: ``` zephyr_sources_ifdef() ``` instead of ``` zephyr_library() zephyr_library_sources_ifdef() ``` This results in a messy Zephyr lib as described in: zephyrproject-rtos#8825 One reason for drivers to use the first approach is because an empty Zephyr library results in a CMake build failure which again leads to twister issues when just enabling a driver and build for all known boards and then process the DTS result. Secondly, a CMake build failure prevents the user from launching menuconfig and disable the driver that creates the empty library. See zephyrproject-rtos#9573 for extra details. This commit verifies all Zephyr libraries, and if a library is found to have no source files it will be excluded from the build and a warning will be printed to the user. Printing a warning instead of a hard failure ensures that: - menuconfig can still be opened - CMake does not fail which allows twister to advance in the test case - Makes it possible to cleanup CMakeLists driver files Signed-off-by: Torsten Rasmussen <[email protected]>
Several driver libraries uses: ``` zephyr_sources_ifdef() ``` instead of ``` zephyr_library() zephyr_library_sources_ifdef() ``` This results in a messy Zephyr lib as described in: #8825 One reason for drivers to use the first approach is because an empty Zephyr library results in a CMake build failure which again leads to twister issues when just enabling a driver and build for all known boards and then process the DTS result. Secondly, a CMake build failure prevents the user from launching menuconfig and disable the driver that creates the empty library. See #9573 for extra details. This commit verifies all Zephyr libraries, and if a library is found to have no source files it will be excluded from the build and a warning will be printed to the user. Printing a warning instead of a hard failure ensures that: - menuconfig can still be opened - CMake does not fail which allows twister to advance in the test case - Makes it possible to cleanup CMakeLists driver files Signed-off-by: Torsten Rasmussen <[email protected]>
Hi @tejlmand, This issue, marked as an Enhancement, was opened a while ago and did not get any traction. It was just assigned to you based on the labels. If you don't consider yourself the right person to address this issue, please re-assing it to the right person. Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason. @tejlmand you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you. Thanks! |
The current CMake build architecture (or lack of) seems to arbitrary place files in libraries without a clear strategy.
Sometimes dedicated libraries are created, and sometimes files are just placed in libzephyr.a.
Working in an IDE, e.g. Eclipse, this design makes it hard to locate files.
During the following description the sample bluetooth/ipsp is used, but any target and sample would gives similar experience.
As start, it is clear that a file, such as: nrf_rtc_timer.c is probably related to a driver library.
However, this file will not be found in any driver library, instead the file is located in lib zephyr.
Secondly, if one is to obtain an overview of what are considered driver related files, then it is not enough to look into, eg. lib drivers gpio / serial / entropy, some driver files are placed in lib zephyr, e.g.
Same goes for arch_arm.
Following files will be found in lib zephyr:
This leave lib zephyr to look as it has no specific purpose.
No strategy for what should go into this lib.
EDIT: This is part of umbrella issue: #8827
The text was updated successfully, but these errors were encountered: