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 <peress@google.com>
diff --git a/subsys/CMakeLists.txt b/subsys/CMakeLists.txt
index 44d1f82..c59492e 100644
--- a/subsys/CMakeLists.txt
+++ b/subsys/CMakeLists.txt
@@ -19,7 +19,7 @@
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 a8ebd0c..8a07484 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 e053d9f..d4e203c 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
+ <zephyr/dsp/dsp.h> header.
+
+if DSP
+
config DSP_BACKEND_HAS_STATIC
bool
@@ -24,3 +33,5 @@
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 c2b1bc0..d1e6385 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 4511e31..912a703 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