Skip to content

Commit db51733

Browse files
committed
cmake/zephyr: unify cmake rules for src/trace
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/trace/ instead. Link: #8260 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 5c0a60c commit db51733

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/trace/CMakeLists.txt

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

3-
add_local_sources(sof dma-trace.c trace.c)
3+
if(CONFIG_TRACE)
4+
add_local_sources(sof dma-trace.c trace.c)
5+
endif()

zephyr/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ add_subdirectory(../src/ipc/ ipc_unused_install/)
211211
add_subdirectory(../src/lib/ lib_unused_install/)
212212
add_subdirectory(../src/library_manager/ library_manager_unused_install/)
213213
add_subdirectory(../src/schedule/ schedule_unused_install/)
214+
add_subdirectory(../src/trace/ trace_unused_install/)
214215
add_subdirectory(test/)
215216

216-
217217
# Old way below: all .c files added by this giant CMake file.
218218

219219
# Intel TGL and CAVS 2.5 platforms
@@ -476,10 +476,6 @@ zephyr_library_sources(
476476
# SOF module interface functions
477477
add_subdirectory(../src/module module_unused_install/)
478478

479-
zephyr_library_sources_ifdef(CONFIG_TRACE
480-
${SOF_SRC_PATH}/trace/dma-trace.c
481-
${SOF_SRC_PATH}/trace/trace.c)
482-
483479
zephyr_library_sources_ifdef(CONFIG_LOG_BACKEND_SOF_PROBE
484480
${SOF_SRC_PATH}/logging/log_backend_probe.c)
485481

0 commit comments

Comments
 (0)