From 0f174e5758ace861f556d94a41137b8a943c2e74 Mon Sep 17 00:00:00 2001 From: Yuval Peress Date: Mon, 5 Dec 2022 21:53:07 -0700 Subject: [PATCH] zdsp: Fix missing kconfig and no source library Adds a missing menuconfig for the DSP library as well as fix an issue with the zephyr library being a STATIC library and having no sources in the case of the cmsis backend. Signed-off-by: Yuval Peress --- subsys/CMakeLists.txt | 2 +- subsys/dsp/CMakeLists.txt | 4 ---- subsys/dsp/Kconfig | 11 +++++++++++ subsys/dsp/cmsis/CMakeLists.txt | 2 +- tests/subsys/dsp/basicmath/prj.conf | 1 + 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/subsys/CMakeLists.txt b/subsys/CMakeLists.txt index 44d1f82eab8..c59492e7725 100644 --- a/subsys/CMakeLists.txt +++ b/subsys/CMakeLists.txt @@ -19,7 +19,7 @@ add_subdirectory(random) add_subdirectory(storage) add_subdirectory_ifdef(CONFIG_SETTINGS settings) add_subdirectory(fb) -add_subdirectory(dsp) +add_subdirectory_ifdef(CONFIG_DSP dsp) add_subdirectory(portability) add_subdirectory(pm) add_subdirectory(stats) diff --git a/subsys/dsp/CMakeLists.txt b/subsys/dsp/CMakeLists.txt index a8ebd0ca921..8a07484fece 100644 --- a/subsys/dsp/CMakeLists.txt +++ b/subsys/dsp/CMakeLists.txt @@ -1,8 +1,4 @@ # Copyright (c) 2022 Google LLC # SPDX-License-Identifier: Apache-2.0 -zephyr_library_named(zdsp) - add_subdirectory_ifdef(CONFIG_DSP_BACKEND_CMSIS cmsis) - -zephyr_link_libraries(zdsp) diff --git a/subsys/dsp/Kconfig b/subsys/dsp/Kconfig index e053d9f6a38..d4e203c5267 100644 --- a/subsys/dsp/Kconfig +++ b/subsys/dsp/Kconfig @@ -1,6 +1,15 @@ # Copyright (c) 2022 Google LLC # SPDX-License-Identifier: Apache-2.0 +menuconfig DSP + bool "DSP subsystem" + help + Include the DSP (Digital Signal Processing) subsystem as a part of the + Zephyr build. This enables applications to include and call into the + header. + +if DSP + config DSP_BACKEND_HAS_STATIC bool @@ -24,3 +33,5 @@ config DSP_BACKEND_CUSTOM added to the 'zdsp' build target by the application or one of its modules. endchoice + +endif # DSP diff --git a/subsys/dsp/cmsis/CMakeLists.txt b/subsys/dsp/cmsis/CMakeLists.txt index c2b1bc0e6f2..d1e6385d4b9 100644 --- a/subsys/dsp/cmsis/CMakeLists.txt +++ b/subsys/dsp/cmsis/CMakeLists.txt @@ -1,4 +1,4 @@ # Copyright (c) 2022 Google LLC # SPDX-License-Identifier: Apache-2.0 -target_include_directories(zdsp PUBLIC public) +zephyr_include_directories(public) diff --git a/tests/subsys/dsp/basicmath/prj.conf b/tests/subsys/dsp/basicmath/prj.conf index 4511e31f3aa..912a703fd9e 100644 --- a/tests/subsys/dsp/basicmath/prj.conf +++ b/tests/subsys/dsp/basicmath/prj.conf @@ -1,6 +1,7 @@ CONFIG_ZTEST=y CONFIG_ZTEST_NEW_API=y CONFIG_NEWLIB_LIBC=y +CONFIG_DSP=y CONFIG_CMSIS_DSP=y CONFIG_CMSIS_DSP_BASICMATH=y CONFIG_DSP_BACKEND_CMSIS=y