From 45280416ff23b6efe09356e9e26d420d52eaad43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 13 Jan 2019 11:26:31 +0100 Subject: [PATCH] modules, particles: type-specific filename prefix Instead of naming the shared libraries libfoo.so, add a type-specific prefix: module_foo.so, or particle_foo.so --- modules/CMakeLists.txt | 2 ++ particles/CMakeLists.txt | 2 ++ plugin.c | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index f700181..189459e 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -6,6 +6,8 @@ target_compile_options(module-sdk INTERFACE ${CAIRO_CFLAGS_OTHER}) target_include_directories(module-sdk INTERFACE ${CAIRO_INCLUDE_DIRS}) target_link_libraries(module-sdk INTERFACE ${CMAKE_THREAD_LIBS_INIT}) +set(CMAKE_SHARED_MODULE_PREFIX module_) + pkg_check_modules(ALSA REQUIRED alsa) add_library(alsa MODULE alsa.c) target_compile_options(alsa PRIVATE ${ALSA_CFLAGS_OTHER}) diff --git a/particles/CMakeLists.txt b/particles/CMakeLists.txt index f3a0c5d..1c41e95 100644 --- a/particles/CMakeLists.txt +++ b/particles/CMakeLists.txt @@ -5,6 +5,8 @@ target_compile_definitions(particle-sdk INTERFACE _GNU_SOURCE) target_compile_options(particle-sdk INTERFACE ${CAIRO_CFLAGS_OTHER}) target_include_directories(particle-sdk INTERFACE ${CAIRO_INCLUDE_DIRS}) +set(CMAKE_SHARED_MODULE_PREFIX particle_) + add_library(empty MODULE empty.c empty.h) target_link_libraries(empty particle-sdk) diff --git a/plugin.c b/plugin.c index 3e665de..31ce260 100644 --- a/plugin.c +++ b/plugin.c @@ -53,7 +53,9 @@ plugin_load(const char *name, enum plugin_type type) } char path[128]; - snprintf(path, sizeof(path), "lib%s.so", name); + snprintf( + path, sizeof(path), "%s_%s.so", + type == PLUGIN_MODULE ? "module" : "particle", name); /* Not loaded - do it now */ void *lib = dlopen(path, RTLD_LOCAL | RTLD_NOW);