Skip to content

Commit 8679ca3

Browse files
committed
cmake/zephyr: decentralize src/debug/
Adding all source files in a single, giant zephyr/CMakeLists.txt is inconvenient and does not scale. Link: #8260 Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 4a6ac13 commit 8679ca3

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

src/debug/CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@ if(CONFIG_GDB_DEBUG)
44
add_subdirectory(gdb)
55
endif()
66

7-
if(CONFIG_COMP_TESTER)
8-
add_subdirectory(tester)
9-
endif()
7+
add_subdirectory(tester)
8+
9+
is_zephyr(it_is)
10+
if(it_is) ### Zephyr ###
11+
12+
add_subdirectory(debug_stream)
13+
add_subdirectory(telemetry)
14+
15+
else() ### Not Zephyr ###
1016

1117
add_local_sources(sof panic.c)
18+
19+
endif() # Zephyr

src/debug/gdb/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# SPDX-License-Identifier: BSD-3-Clause
22

3+
# Common to Zephyr and XTOS
34
add_local_sources(sof
45
gdb.c
56
ringbuffer.c

src/debug/tester/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ if(it_is) ### Zephyr ###
2222

2323
else() ### XTOS ###
2424

25-
add_local_sources(sof ${base_files})
25+
if(CONFIG_COMP_TESTER)
26+
add_local_sources(sof ${base_files})
27+
endif()
2628

2729
endif()

zephyr/CMakeLists.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ set(SOF_AUDIO_MODULES_PATH "${SOF_SRC_PATH}/audio/module_adapter/module")
139139
set(SOF_SAMPLES_PATH "${SOF_SRC_PATH}/samples")
140140
set(SOF_LIB_PATH "${SOF_SRC_PATH}/lib")
141141
set(SOF_DRIVERS_PATH "${SOF_SRC_PATH}/drivers")
142-
set(SOF_DEBUG_PATH "${SOF_SRC_PATH}/debug")
143142
set(SOF_TRACE_PATH "${SOF_SRC_PATH}/trace")
144143

145144
set(RIMAGE_TOP ${sof_top_dir}/tools/rimage)
@@ -204,9 +203,7 @@ macro(sof_list_append_ifdef feature_toggle list)
204203
endmacro()
205204

206205
add_subdirectory(../src/audio/ audio_unused_install/)
207-
add_subdirectory(../src/debug/debug_stream/ debug_stream_unused_install/)
208-
add_subdirectory(../src/debug/telemetry/ telemetry_unused_install/)
209-
add_subdirectory(../src/debug/tester/ debug_tester_unused_install/)
206+
add_subdirectory(../src/debug/ debug_unused_install/)
210207
add_subdirectory(../src/init/ init_unused_install/)
211208
add_subdirectory(../src/ipc/ ipc_unused_install/)
212209
add_subdirectory(../src/math/ math_unused_install/)
@@ -909,11 +906,6 @@ zephyr_library_sources_ifdef(CONFIG_AMS
909906
${SOF_LIB_PATH}/ams.c
910907
)
911908

912-
zephyr_library_sources_ifdef(CONFIG_GDB_DEBUG
913-
${SOF_DEBUG_PATH}/gdb/gdb.c
914-
${SOF_DEBUG_PATH}/gdb/ringbuffer.c
915-
)
916-
917909
zephyr_library_sources_ifdef(CONFIG_DW_DMA
918910
${SOF_DRIVERS_PATH}/dw/dma.c
919911
)

0 commit comments

Comments
 (0)