aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorTaylor Holberton <tay10r@protonmail.com>2020-02-11 14:03:06 -0500
committerGitHub <noreply@github.com>2020-02-11 14:03:06 -0500
commit5389c1f796ea153232a582bd28e73be43638a124 (patch)
tree21c980b1636350b75d1490bad5b9c62c82318f12 /CMakeLists.txt
parent80beaac3f4962f528abaa08f067c58183011c93b (diff)
parente7c627dd74f5d43439792491c291564e298cbb10 (diff)
Merge pull request #137 from codeauroraforum/plugin-support
Plugin support
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 16 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1cc4a85..ba1aea3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,24 +2,37 @@ 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/mixer.c")
+ "src/pcm_hw.c"
+ "src/pcm_plugin.c"
+ "src/snd_card_plugin.c"
+ "src/mixer.c"
+ "src/mixer_hw.c"
+ "src/mixer_plugin.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 +42,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)