-
Notifications
You must be signed in to change notification settings - Fork 663
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: Support multiple overlay files #1184
Conversation
e78a3d2
to
734d062
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.
Good idea.
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.
Looks good. Still to fix up the style failure, though.
The style failure is nonsensical though, it suggests: diff --git a/config.cmake b/config.cmake
index e33b8721..3fc6ee6c 100644
--- a/config.cmake
+++ b/config.cmake
@@ -124,7 +124,9 @@ if(DEFINED KernelDTSList AND (NOT "${KernelDTSList}" STREQUAL ""))
set(config_schema "${CMAKE_CURRENT_SOURCE_DIR}/tools/hardware_schema.yml")
set(
KernelCustomDTSOverlay ""
- CACHE STRING "Provide an additional list of overlays to append to the selected KernelPlatform's \
+ CACHE
+ STRING
+ "Provide an additional list of overlays to append to the selected KernelPlatform's \
device tree during build time"
)
if(NOT "${KernelCustomDTSOverlay}" STREQUAL "") |
Unfortunately, we have to accept this for now. Otherwise this issue will pop up again for every future change of this file, that is also annoying. It's not the only case where the tool's rules seem to lack something. Maybe this gets fixed in future versions (see also seL4/ci-actions#329) |
Agreed, but it's very annoying that we have nonsensical style checks to begin with, supposedly someone put effort in adding them at one point in time.
As far as I can tell there are no sensible style checks done for CMake files, so I would personally just disable style checking for CMake files altogether. For instance, it's currently impossible to make a config string description that doesn't look horrible in ccmake because the style checker enforces a lot of whitespace before new lines. |
endif() | ||
list(APPEND KernelDTSList "${KernelCustomDTSOverlay}") | ||
message(STATUS "Using ${KernelCustomDTSOverlay} overlay") | ||
foreach(dts_entry IN ITEMS ${KernelCustomDTSOverlay}) |
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.
In this case, can't we drop the if(NOT "${KernelCustomDTSOverlay}" STREQUAL "")
and just iterate? Iterating over an empty variable would just do nothing then.
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.
The if deals with the case that the variable can be left unassigned. The inner foreach block relies on the variable having an assigned value to dereference.
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.
This is where you could use foreach(dts_entry IN LISTS KernelCustomDTSOverlay)
, which aviods the dereferencing.
The cmake style checks are made by cmake-format and are generally sensible. It has a few situations (like this one) where it produces output that is not ideal, but the TSC decision on that is that it is much preferred to have that than constant discussion about what is better. |
Allow multiple overlay files to be specified. This supports custom tooling support to add additional memory reserve regions to a platform. Signed-off-by: Kent McLeod <kent@kry10.com>
734d062
to
c2631cb
Compare
Allow multiple overlay files to be specified. This supports custom tooling support to add additional memory reserve regions to a platform.
EG: