Skip to content

Commit 5b54fa7

Browse files
committed
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>
1 parent 3aba292 commit 5b54fa7

File tree

2 files changed

+28
-80
lines changed

2 files changed

+28
-80
lines changed

src/debug/tester/CMakeLists.txt

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1-
add_local_sources(tester.c)
2-
add_local_sources(tester_dummy_test.c)
3-
add_local_sources(tester_simple_dram_test.c)
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
3+
set(base_files
4+
tester.c
5+
tester_dummy_test.c
6+
tester_simple_dram_test.c
7+
)
8+
9+
is_zephyr(it_is)
10+
if(it_is) ### Zephyr ###
11+
12+
if(CONFIG_COMP_TESTER STREQUAL "m")
13+
14+
add_subdirectory(llext ${PROJECT_BINARY_DIR}/tester_llext)
15+
add_dependencies(app tester)
16+
17+
elseif(CONFIG_COMP_TESTER)
18+
19+
zephyr_library_sources(${base_files})
20+
21+
endif()
22+
23+
else() ### XTOS ###
24+
25+
add_local_sources(sof ${base_files})
26+
27+
endif()

zephyr/CMakeLists.txt

Lines changed: 1 addition & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -203,20 +203,8 @@ add_subdirectory(../src/init/ init_unused_install/)
203203
add_subdirectory(../src/ipc/ ipc_unused_install/)
204204
add_subdirectory(../src/debug/telemetry/ telemetry_unused_install/)
205205
add_subdirectory(../src/debug/debug_stream/ debug_stream_unused_install/)
206+
add_subdirectory(../src/debug/tester/ debug_tester_unused_install/)
206207
add_subdirectory(../src/schedule/ schedule_unused_install/)
207-
208-
if(CONFIG_COMP_TESTER STREQUAL "m")
209-
add_subdirectory(${SOF_DEBUG_PATH}/tester/llext
210-
${PROJECT_BINARY_DIR}/tester_llext)
211-
add_dependencies(app tester)
212-
elseif(CONFIG_COMP_TESTER)
213-
zephyr_library_sources_ifdef(CONFIG_COMP_TESTER
214-
${SOF_DEBUG_PATH}/tester/tester.c
215-
${SOF_DEBUG_PATH}/tester/tester_dummy_test.c
216-
${SOF_DEBUG_PATH}/tester/tester_simple_dram_test.c
217-
)
218-
endif()
219-
220208
add_subdirectory(test/)
221209

222210

@@ -514,57 +502,6 @@ zephyr_library_sources_ifdef(CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL
514502
${SOF_LIB_PATH}/cpu-clk-manager.c
515503
)
516504

517-
# Optional math utility
518-
zephyr_library_sources_ifdef(CONFIG_MATH_LUT_SINE_FIXED
519-
${SOF_MATH_PATH}/lut_trig.c
520-
)
521-
522-
zephyr_library_sources_ifdef(CONFIG_MATH_FFT
523-
${SOF_MATH_PATH}/fft/fft_common.c
524-
)
525-
526-
zephyr_library_sources_ifdef(CONFIG_MATH_16BIT_FFT
527-
${SOF_MATH_PATH}/fft/fft_16.c
528-
${SOF_MATH_PATH}/fft/fft_16_hifi3.c
529-
)
530-
531-
zephyr_library_sources_ifdef(ONFIG_MATH_32BIT_FFT
532-
${SOF_MATH_PATH}/fft/fft_32.c
533-
${SOF_MATH_PATH}/fft/fft_32_hifi3.c
534-
)
535-
536-
zephyr_library_sources_ifdef(CONFIG_MATH_DCT
537-
${SOF_MATH_PATH}/dct.c
538-
)
539-
540-
zephyr_library_sources_ifdef(CONFIG_MATH_WINDOW
541-
${SOF_MATH_PATH}/window.c
542-
)
543-
544-
zephyr_library_sources_ifdef(CONFIG_MATH_MATRIX
545-
${SOF_MATH_PATH}/matrix.c
546-
)
547-
548-
zephyr_library_sources_ifdef(CONFIG_MATH_AUDITORY
549-
${SOF_MATH_PATH}/auditory/auditory.c
550-
)
551-
552-
zephyr_library_sources_ifdef(CONFIG_MATH_16BIT_MEL_FILTERBANK
553-
${SOF_MATH_PATH}/auditory/mel_filterbank_16.c
554-
)
555-
556-
zephyr_library_sources_ifdef(CONFIG_MATH_32BIT_MEL_FILTERBANK
557-
${SOF_MATH_PATH}/auditory/mel_filterbank_32.c
558-
)
559-
560-
zephyr_library_sources_ifdef(CONFIG_NATURAL_LOGARITHM_FIXED
561-
${SOF_MATH_PATH}/log_e.c
562-
)
563-
564-
zephyr_library_sources_ifdef(CONFIG_BINARY_LOGARITHM_FIXED
565-
${SOF_MATH_PATH}/base2log.c
566-
)
567-
568505
# SOF module interface functions
569506
add_subdirectory(../src/module module_unused_install/)
570507

@@ -632,19 +569,6 @@ elseif(CONFIG_COMP_IIR)
632569
)
633570
endif()
634571

635-
if(CONFIG_MATH_FIR STREQUAL "m")
636-
add_subdirectory(${SOF_MATH_PATH}/fir_llext
637-
${PROJECT_BINARY_DIR}/fir_llext)
638-
add_dependencies(app fir)
639-
elseif(CONFIG_MATH_FIR)
640-
zephyr_library_sources(
641-
${SOF_MATH_PATH}/fir_generic.c
642-
${SOF_MATH_PATH}/fir_hifi2ep.c
643-
${SOF_MATH_PATH}/fir_hifi3.c
644-
${SOF_MATH_PATH}/fir_hifi5.c
645-
)
646-
endif()
647-
648572
zephyr_library_sources_ifdef(CONFIG_MATH_IIR_DF1
649573
${SOF_MATH_PATH}/iir_df1_generic.c
650574
${SOF_MATH_PATH}/iir_df1_hifi3.c

0 commit comments

Comments
 (0)