Skip to content

Commit 8bbe7c6

Browse files
committed
cmake/zephyr: unify cmake rules for src/audio/rtnr
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/rtnr instead. Link: #8260 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 738c5f9 commit 8bbe7c6

File tree

3 files changed

+26
-25
lines changed

3 files changed

+26
-25
lines changed

src/audio/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
7575
if(CONFIG_COMP_MUX)
7676
add_subdirectory(mux)
7777
endif()
78+
if(CONFIG_COMP_RTNR)
79+
add_subdirectory(rtnr)
80+
endif()
7881
if(CONFIG_COMP_SEL)
7982
add_subdirectory(selector)
8083
endif()
@@ -140,9 +143,6 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
140143
dai-legacy.c
141144
)
142145
endif()
143-
if(CONFIG_COMP_RTNR)
144-
add_subdirectory(rtnr)
145-
endif()
146146
if(CONFIG_INTEL_ADSP_MIC_PRIVACY)
147147
add_subdirectory(mic_privacy_manager)
148148
endif()

src/audio/rtnr/CMakeLists.txt

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
# SPDX-License-Identifier: BSD-3-Clause
22

3-
add_local_sources(sof rtnr.c)
4-
5-
if (CONFIG_COMP_RTNR_STUB)
6-
add_local_sources(sof rtnr_stub.c)
7-
elseif(CONFIG_TIGERLAKE)
8-
add_subdirectory(rtklib/tgl)
9-
elseif(CONFIG_MT8195)
10-
add_subdirectory(rtklib/mt8195)
3+
if(CONFIG_COMP_RTNR STREQUAL "m")
4+
add_subdirectory(llext ${PROJECT_BINARY_DIR}/rtnr_llext)
5+
add_dependencies(app rtnr)
6+
return()
7+
endif()
8+
9+
is_zephyr(zephyr)
10+
if(zephyr) ### Zephyr ###
11+
12+
zephyr_library_sources(rtnr.c)
13+
zephyr_library_sources_ifdef(CONFIG_COMP_RTNR_STUB rtnr_stub.c)
14+
15+
else() ### XTOS ###
16+
17+
add_local_sources(sof rtnr.c)
18+
if (CONFIG_COMP_RTNR_STUB)
19+
add_local_sources(sof rtnr_stub.c)
20+
elseif(CONFIG_TIGERLAKE)
21+
add_subdirectory(rtklib/tgl)
22+
elseif(CONFIG_MT8195)
23+
add_subdirectory(rtklib/mt8195)
24+
endif()
25+
1126
endif()

zephyr/CMakeLists.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -524,20 +524,6 @@ zephyr_library_sources_ifdef(CONFIG_LIBRARY_MANAGER
524524
)
525525
endif()
526526

527-
if(CONFIG_COMP_RTNR STREQUAL "m")
528-
add_subdirectory(${SOF_AUDIO_PATH}/rtnr/llext
529-
${PROJECT_BINARY_DIR}/rtnr_llext)
530-
add_dependencies(app rtnr)
531-
elseif(CONFIG_COMP_RTNR)
532-
zephyr_library_sources(
533-
${SOF_AUDIO_PATH}/rtnr/rtnr.c
534-
)
535-
536-
zephyr_library_sources_ifdef(CONFIG_COMP_RTNR_STUB
537-
${SOF_AUDIO_PATH}/rtnr/rtnr_stub.c
538-
)
539-
endif()
540-
541527
if(CONFIG_SAMPLE_SMART_AMP STREQUAL "m")
542528
add_subdirectory(${SOF_SAMPLES_PATH}/audio/smart_amp_test_llext
543529
${PROJECT_BINARY_DIR}/smart_amp_test_llext)

0 commit comments

Comments
 (0)