sof icon indicating copy to clipboard operation
sof copied to clipboard

[FEATURE] remove duplicated C files additions in CMake rules for src/audio/ modules

Open kv2019i opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe. The list of files to build is duplicated for the shared-library build. Once time in top-level src/audio/CMakeLists.txt and second time in subfolders.

kv2019i avatar Dec 11 '23 11:12 kv2019i

Found in

  • #8595
  • https://github.com/thesofproject/sof/pull/8514/files#r1404344228

Should probably be done before zephyr cleanup:

  • #8260

Originally posted by @marc-hb in https://github.com/thesofproject/sof/pull/8595#discussion_r1422017934

why do we need to enumerate sources twice, once in src/audio/CMakeLists.txt and then in src/audio/mux/CMakeLists.txt ?

Looks like @btian1 didn't know (I'm afraid he's submitting uncompiled search/replace) so I had a look at this myself. The answer is: src/audio/CMakeLists.txt code after line 119 is only for CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD. There is a very confusing return() on that line which makes the code after it not indented. So this is one of the explanation for the mass copy/paste/diverge.

Good thing I just added a Github Action for the ALSA plugin. It may still be incorrect but at least it will still compile?

This part of the CMake code is significantly more messy that the rest, it's going to be a huge effort to clean all that technical debt (if ever)

marc-hb avatar Dec 11 '23 15:12 marc-hb

Stable-v2.9 branched, this didn't make the cut, bumping to 2.10.

kv2019i avatar Mar 04 '24 13:03 kv2019i