Skip to content
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: src/audio/CMakeLists.txt unification part 2 #9912

Merged
merged 17 commits into from
Mar 25, 2025

Conversation

kv2019i
Copy link
Collaborator

@kv2019i kv2019i commented Mar 20, 2025

Follow-up to #9906

This now converts all the remaining "simple cases" in src/audio.

I will submit separate PRs for remaining cases with added logic to handle stubs and 3p library integration. Also module_adapter will be a separate PR.

Link: #8260

Copy link
Collaborator

@lyakh lyakh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using return()s could reduce some patches a bit, but not too important

@@ -31,6 +31,9 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
kpb.c
)
endif()
if(CONFIG_COMP_MIXER)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(a general comment to an earlier discussion) I think optically I actually prefer TAB over "two spaces" indentation. And cmake shouldn't really go beyond 3 levels of indentation... So 8-space TABs shouldn't exceed maximum line length

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lyakh I'll redirect to https://github.com/orgs/thesofproject/discussions/9899 and note that even the "Mastering CMake" O'Reily book follows the 2-space indent ;)

add_local_sources(sof tdfb_ipc4.c)
if(CONFIG_COMP_TDFB STREQUAL "m")
add_subdirectory(llext ${PROJECT_BINARY_DIR}/tdfb_llext)
add_dependencies(app tdfb)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not return() as in others?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lyakh Ack, this might have been a return() case. I've used two approaches to convert src/audio/foo/ build rules:

  1. if-else if the non-llext code had a single or two statements, or I anyways needed to touch the existing non-llext code.

  2. use return() f there was more logic in the CMakeLists.txt for the module that I did not need to touch.

I think this might have been better as a (2) case.

kv2019i added 14 commits March 25, 2025 12:18
Split the build directory listing into two. First introduce directories
that add auxiliary modules to the build. These directories provide
modules that may be used by other modules. Then a second list for all
other directories.

This split avoids dependency issues with llext modules that require
auxiliary modules to be introduced first.

Signed-off-by: Kai Vehmanen <[email protected]>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/mixer instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/mixin_mixout/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/copier/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/volume/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio for base_fw
and chain_dma modules.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/pcm_converter/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
Add inline comments to explain how the build rules are
organized and ordered in the file.

Signed-off-by: Kai Vehmanen <[email protected]>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/aria/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/crossover/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/drc/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/tdbf/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/up_down_mixer/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
kv2019i added 3 commits March 25, 2025 12:21
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/mux/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/multiband_drc/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/mfcc/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <[email protected]>
@kv2019i kv2019i force-pushed the 202403-cmake-decentr-audio-part2 branch from b3e12a0 to 47a7b81 Compare March 25, 2025 10:31
@kv2019i
Copy link
Collaborator Author

kv2019i commented Mar 25, 2025

New version pushed:

  • split module directory lists into separate auxiliary and main modules (a crude fix to llext dependencies, will file a ticket to solve this better)
  • rebase on top of latest main (as main moves math to be built as a module, which triggers the dependency problem)

@kv2019i
Copy link
Collaborator Author

kv2019i commented Mar 25, 2025

Stub error are due to Zephyr upstream bug zephyrproject-rtos/zephyr#87475 . PTL alsabat fail is known and tracked in https://github.com/thesofproject/sof/issues?q=is%3Aissue+is%3Aopen+label%3A%22Known+PR+Failures%22+ . Proceeding with merge.

@kv2019i kv2019i merged commit 5d97545 into thesofproject:main Mar 25, 2025
44 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DNM Do Not Merge tag
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants