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/radio/CMakeLists.txt | 10 ++++++++++ plugins/radio/radio-api.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 plugins/radio/CMakeLists.txt (limited to 'plugins/radio') diff --git a/plugins/radio/CMakeLists.txt b/plugins/radio/CMakeLists.txt new file mode 100644 index 00000000..c7c85411 --- /dev/null +++ b/plugins/radio/CMakeLists.txt @@ -0,0 +1,10 @@ +IF(librtlsdr_FOUND) + + INCLUDE_DIRECTORIES(${include_dirs}) + + ADD_LIBRARY(radio-api MODULE radio-api.c radio-rtlsdr.c) + SET_TARGET_PROPERTIES(radio-api PROPERTIES PREFIX "") + INSTALL(TARGETS radio-api + LIBRARY DESTINATION ${plugin_install_dir}) + +ENDIF(librtlsdr_FOUND) diff --git a/plugins/radio/radio-api.c b/plugins/radio/radio-api.c index 3de8e044..cfa25995 100644 --- a/plugins/radio/radio-api.c +++ b/plugins/radio/radio-api.c @@ -327,7 +327,7 @@ STATIC AFB_restapi pluginApis[]= { {NULL} }; -PUBLIC AFB_plugin* radioRegister () { +PUBLIC AFB_plugin* pluginRegister () { AFB_plugin *plugin = malloc (sizeof(AFB_plugin)); plugin->type = AFB_PLUGIN_JSON; plugin->info = "Application Framework Binder - Radio plugin"; -- cgit 1.2.3-korg