-
Notifications
You must be signed in to change notification settings - Fork 349
cmake/zephyr: decentralize src/{debug/tester,math} #9901
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/zephyr: decentralize src/{debug/tester,math} #9901
Conversation
|
Note: using the Zephyr cmake style for all new/rewritten files, see https://github.com/orgs/thesofproject/discussions/9899 |
lgirdwood
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.
LGTM
Adding all source files in a single, giant zephyr/CMakeLists.txt is inconvenient and does not scale. Link: thesofproject#8260 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Adding all source files in a single, giant zephyr/CMakeLists.txt is inconvenient and does not scale. Align new cmake files with: https://docs.zephyrproject.org/latest/contribute/style/cmake.html Link: thesofproject#8260 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Now that cmake rules are moved to same directory as source files, no need to specify the full path for source files. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reorder the add_subdirectory() statements to alphabetical order. There will be more entries here, so better to organize this list now. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
970e7ae to
29f495e
Compare
| if(CONFIG_CORDIC_FIXED) | ||
| add_local_sources(sof trig.c) | ||
| list(APPEND base_files trig.c) | ||
| endif() |
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.
can a add_list_ifdef() cmake function be used? I'm not a cmake expert, so not sure whether objects are passed by reference
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.
@lyakh I was going back and forth with this. Not an cmake expert here either, but given we need new owners for cmake magic in SOF, we probably need to just learn more.
We could add a function, but we'd need to add it as a SOF extension (Zephyr has list_append_if() but we can't use that).
What I'm personally not sure is that is it worth it to save some lines in definitions versus keeping SOF cmake files as close to standard cmake files as possible. I.e. functions that are used are standard cmake functions. Most of people contributing to SOF will not be cmake experts either.
On the other hand, we have a LOT of use for add_local_sources_if(), so having a replacement macro that facilitates Zephyr/XTOS might still be useful.
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.
Update: hmm, it seems add_local_sources_if() is already a "SOF'ism", a macro defined and used only in SOF. So it seems we've already gone the path to use SOF specific macros to avoid repetition. I can update to this approach.
cmake/zephyr: decentralize src/math/
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.
Align new cmake files with:
https://docs.zephyrproject.org/latest/contribute/style/cmake.html
Link: #8260
Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com
cmake/zephyr: decentralize src/debug/tester/
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.
Link: #8260
Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com
Marking as draft until #9896 is merged (part of this PR).