-
Notifications
You must be signed in to change notification settings - Fork 240
Improve CMake handling of config defaults file #113
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
Conversation
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.
No issues found across 1 file
|
Hi thank you for the PR I'm aware of the bug but haven't had time to fix it yet, i'm sorry about that As for the changes here:
Right now it doesn't quite work that way because CONFIG is stored and the next build time it will copy the wayland config again overriding the manual changes done Fyi: the current workaround is this one, and will work okay, it just feels weird having to manually bootstrap cmake twice I would gladly merge a PR that makes the ideal solution work |
That's easy then, those files can be added to
Maybe we could just switch to using defconfig/Kconfig and drop the defaults files, seems to be the way projects are going and Kconfig would be the nature choice for Linux (this being the Linux port project).
The issue is that breaks a principle that the build should not modify the source files. All changes should be done to copies made in the output/build directory. It is also confusing, as you said, that the config will be overwritten on later build/configure steps. How about one just modifies the file they want in place, so for wayland: This also works in any order since the config file can be added to the CMake depends, so changing the config after is also valid: |
67c66a1 to
124d726
Compare
TIL. That's good to know, thank you!
It has been discussed and we decided to not use it because the .defaults format is LVGL's built-in way of handling it and we'd like to use this project as a reference on how to use it even for other projects that might not be linux based We might end up moving to KConfig at some point but that's not in the plans for now
This is untrue, source files are not modified by the build system, instead it generates
That's a bug and shouldn't happen, like I mentioned previously
It's an idea but I liked the idea of not having to "think" about which file to modify. One disadvantage is of course the fact that we're losing the previous config when doing it but i'm not sure if it's a big problem Anyways, since you already implemented it that way and it fixes the current bug, i'll go ahead and approve that approach, just please:
|
This reverts commit de589ca. Using option() instead of set() adds the variable to the cache just the same, so this commit was not effective. The commit was also broken as option() also forces the variable to be a BOOL, but CONFIG is a STRING. This causes CONFIG to be set to OFF in the cache when no -DCONFIG is set which causes build failures: CMake Error at CMakeLists.txt:36 (message): Config file not found: /home/a0226330local/projects/lvgl/lv_port_linux/configs/OFF.defaults Signed-off-by: Andrew Davis <afd@ti.com>
The file linux-default-settings.defaults is a reference for the set of settings that are common to all config files. It is meant as a template for starting new config files, not to be used directly. Move this to a new directory to avoid confusion. Signed-off-by: Andrew Davis <afd@ti.com>
These files are copied to the build directory but then never used during the build, instead the command to generate lv_conf.h below uses the original source files. Skip this unneeded copy. Instead add these files to CMake's CONFIGURE_DEPENDS so that CMake will still reconfigure if these source files change. Signed-off-by: Andrew Davis <afd@ti.com>
When a non-default lv_conf.defaults is used it is currenly copied out of the configs/ directory replacing the existing lv_conf.defaults file. This makes changes to source files during build which should be avoided, only modifications should happen in the build directory. There is no need to do this as we can simply update the path used to locate lv_conf.defaults in CMake to the non-default file path and use it just the same. Signed-off-by: Andrew Davis <afd@ti.com>
The function of the CONFIG CMake variable has slightly changed to not perform a copy of the selected .defconfig file. Update the documentation to make this behavior clear. Signed-off-by: Andrew Davis <afd@ti.com>
124d726 to
1dd9881
Compare
AndreCostaaa
left a comment
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.
Thank you 🚀
Summary by cubic
Simplified CMake config selection to avoid modifying the source tree and fixed a bug that could set CONFIG to OFF, causing build failures. Builds now reference the chosen defaults file directly and skip copying unused generator files.
Bug Fixes
Refactors
Written for commit 1dd9881. Summary will update automatically on new commits.