diff options
author | Bhalchandra Gajare <gajare@codeaurora.org> | 2019-09-04 15:32:35 -0700 |
---|---|---|
committer | Rohit kumar <rohitkr@codeaurora.org> | 2020-02-07 12:16:27 +0530 |
commit | 986b8e338782a4c8aab83e626949ed5457eb5b69 (patch) | |
tree | 5ca7b4cb0bb6c02f8da26e043d7b28c4ab3ee084 /CMakeLists.txt | |
parent | 1923b9b0fd7116ba235a812ef00fd6c7c9ed363d (diff) |
tinyalsa: add support for PCM plugins
Update the pcm framework to support plugins. Resolve the pcm device node
to be either kernel device or virtual device and setup function pointers
accordingly. Implement framework functionality for pcm_plugin.c for ease
of plugin development. Plugin itself is compiled as shared object (.so)
and dynamically linked from pcm_plugin.c.
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cb31c58..77227d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,24 +2,35 @@ cmake_minimum_required(VERSION 3.0.2) project("TinyALSA" C) +option(TINYALSA_USES_PLUGINS "Whether or not to build with plugin support" OFF) + +if (TINYALSA_USES_PLUGINS) + set (plugin_opt -DTINYALSA_USES_PLUGINS=1) +endif (TINYALSA_USES_PLUGINS) + set (HDRS "include/tinyalsa/attributes.h" "include/tinyalsa/version.h" "include/tinyalsa/asoundlib.h" "include/tinyalsa/pcm.h" + "include/tinyalsa/plugin.h" "include/tinyalsa/mixer.h") set (SRCS "src/pcm.c" + "src/pcm_hw.c" + "src/pcm_plugin.c" + "src/snd_card_plugin.c" "src/mixer.c") add_library("tinyalsa" ${HDRS} ${SRCS}) -target_compile_options("tinyalsa" PRIVATE -Wall -Wextra -Werror -Wfatal-errors) +target_compile_options("tinyalsa" PRIVATE -Wall -Wextra -Werror -Wfatal-errors ${plugin_opt}) target_include_directories("tinyalsa" PRIVATE "include") macro(ADD_EXAMPLE EXAMPLE) add_executable(${EXAMPLE} ${ARGN}) target_link_libraries(${EXAMPLE} "tinyalsa") + target_link_libraries(${EXAMPLE} "dl") target_include_directories(${EXAMPLE} PRIVATE "include") endmacro(ADD_EXAMPLE EXAMPLE) @@ -29,6 +40,7 @@ add_example("pcm-writei" "examples/pcm-writei.c") macro(ADD_UTIL UTIL) add_executable(${UTIL} ${ARGN}) target_link_libraries(${UTIL} "tinyalsa") + target_link_libraries(${UTIL} "dl") target_compile_options(${UTIL} PRIVATE -Wall -Wextra -Werror -Wfatal-errors) target_include_directories(${UTIL} PRIVATE "include") endmacro(ADD_UTIL UTIL) |