-
Notifications
You must be signed in to change notification settings - Fork 322
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
audio/CMakeLists.txt: move testbench/plugin to new, separate file #8892
base: main
Are you sure you want to change the base?
Conversation
Commit 7680a7b ("cmake: add testbench host build") added `if (CONFIG_LIBRARY) return()` in `src/ipc/CMakeLists.txt` to exclude some .c files from testbench compilation. Then commit 8b680d5 ("host: enable ipc handler module") moved the `return()` later in the files to exclude fewer files and add more files to fuzzing. Then commit 0a7df45 ("library: add trace and shared memory region") moved it down again to add more files. Then commit d62e926 ("ipc: split IPC major code into IPC specific directories") removed the last bit of code that was still after the return() Now there is no code left after the `return()`!? Remove it. Signed-off-by: Marc Herbert <[email protected]>
Commit 7680a7b ("cmake: add testbench host build") added a `return()` in the middle of `src/audio/CMakeLists.txt` to exclude some C files from testbench compilation. It wasn't easy to read already at the time. Now that the file has grown bigger it's become even harder to spot and even more confusing. Soon, thesofproject#8260 will also add Zephyr to this file which will make things much worse. Solve all this by moving testbench and plugin compilation to a new, separate, `native.cmake` file. Reported in thesofproject#8606 Signed-off-by: Marc Herbert <[email protected]>
This comment was marked as outdated.
This comment was marked as outdated.
@marc-hb Slowly, QB is getting back on track. After checking the build once again, FW building and tests in the Internal Intel CI system turn green |
Newer https://sof-ci.01.org/sof-pr-viewer/#/build/PR8892/build13655958 is green - thanks! |
@@ -0,0 +1,108 @@ | |||
# SPDX-License-Identifier: BSD-3-Clause |
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.
"native" could be a bit ambiguous, lets spell out plugin.cmake and have a comment here that says this is to build plugin, testbench etc.
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.
We had the same discussion when coining CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD . Maybe stick to that name and have "audio/module_shared_library.cmake". I can live with "plugin.cmake" as well.
subdirs(pipeline) | ||
|
||
if(CONFIG_COMP_MODULE_ADAPTER) | ||
add_subdirectory(module_adapter) |
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 like an extra tab here
I naively trusted the Kconfig help added for
But after testing a bit more I just realized that this recent I also remembered that the testbench supports both "native" and non-native code. Neither uses
The mystery deepens... More context than anyone wants: "native" is the non-negative term used by Zephyr to say "not compiled for the product": "module", "shared" and "library" are all ambiguous now that we have shared "modules" / "libraries" running on DSP hardware too:
"host" can be quite ambiguous too: |
Lets just say any make target that does not run on the DSP can have a Cmake.plugin Cmake.testbench etc.. Need to be quick if this is for v2.9 |
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.
Thanks for the detailed history in git commit messages, that was very helpful when reviewing the patches! No obstacles, I think only open is how native.cmake is named, see inline comments from Liam and me.
@@ -0,0 +1,108 @@ | |||
# SPDX-License-Identifier: BSD-3-Clause |
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.
We had the same discussion when coining CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD . Maybe stick to that name and have "audio/module_shared_library.cmake". I can live with "plugin.cmake" as well.
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.
@marc-hb I think the SOF alsa plugin is the sole user of shared library version. Testbench and Cmocka unit tests are static builds.
set(mixer_src mixer/mixer.c mixer/mixer_generic.c mixer/mixer_hifi3.c) | ||
elseif(CONFIG_IPC_MAJOR_4) | ||
set(mixer_src mixin_mixout/mixin_mixout.c mixin_mixout/mixin_mixout_generic.c mixin_mixout/mixin_mixout_hifi3.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.
Why is mixer here and not with other components later?
@marc-hb Any update here ? |
Needed for #9025 |
Pure cleanup to prepare de-duplication #8260, zero functional change.
2 commits, the main one:
Commit 7680a7b ("cmake: add testbench host build") added a
return()
in the middle ofsrc/audio/CMakeLists.txt
to exclude someC files from testbench compilation.
It wasn't easy to read already at the time. Now that the file has grown
bigger it's become even harder to spot and even more confusing.
Soon, #8260 will also add Zephyr to this file which will make things
much worse.
Solve all this by moving testbench and plugin compilation to a new,
separate,
native.cmake
file.Reported in #8606