From 98f5843474dcec55827279b6f42007341c171ae0 Mon Sep 17 00:00:00 2001 From: Manuel Bachmann Date: Mon, 21 Dec 2015 06:57:05 +0100 Subject: Switch to a plugin model Each API now compiles to a ".so" file, which gets searched for in the "${libdir}/afb" directory at startup. We can now load an arbitrary number of plugins (> 10). Signed-off-by: Manuel Bachmann --- plugins/audio/CMakeLists.txt | 10 ++++++++++ plugins/audio/audio-api.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 plugins/audio/CMakeLists.txt (limited to 'plugins/audio') diff --git a/plugins/audio/CMakeLists.txt b/plugins/audio/CMakeLists.txt new file mode 100644 index 00000000..b5adc643 --- /dev/null +++ b/plugins/audio/CMakeLists.txt @@ -0,0 +1,10 @@ +IF(alsa_FOUND) + + INCLUDE_DIRECTORIES(${include_dirs}) + + ADD_LIBRARY(audio-api MODULE audio-api.c audio-alsa.c) + SET_TARGET_PROPERTIES(audio-api PROPERTIES PREFIX "") + INSTALL(TARGETS audio-api + LIBRARY DESTINATION ${plugin_install_dir}) + +ENDIF(alsa_FOUND) diff --git a/plugins/audio/audio-api.c b/plugins/audio/audio-api.c index 53a4beab..60a5a962 100644 --- a/plugins/audio/audio-api.c +++ b/plugins/audio/audio-api.c @@ -223,7 +223,7 @@ STATIC AFB_restapi pluginApis[]= { {NULL} }; -PUBLIC AFB_plugin *audioRegister () { +PUBLIC AFB_plugin *pluginRegister () { AFB_plugin *plugin = malloc (sizeof(AFB_plugin)); plugin->type = AFB_PLUGIN_JSON; plugin->info = "Application Framework Binder - Audio plugin"; -- cgit 1.2.3-korg