From 9481b4f2960c560ec8297bdc37d8014230072a5c Mon Sep 17 00:00:00 2001 From: José Bollo Date: Wed, 18 May 2016 17:29:26 +0200 Subject: improves the build system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idad84e88cd8c21d111ce7ed44340f6d2b0fccb37 Signed-off-by: José Bollo --- plugins/audio/CMakeLists.txt | 19 ++++++++++++++++--- plugins/audio/audio-api.c | 2 +- plugins/audio/export.map | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 plugins/audio/export.map (limited to 'plugins/audio') diff --git a/plugins/audio/CMakeLists.txt b/plugins/audio/CMakeLists.txt index ee858b4c..2d74fd62 100644 --- a/plugins/audio/CMakeLists.txt +++ b/plugins/audio/CMakeLists.txt @@ -1,13 +1,26 @@ +INCLUDE(FindPkgConfig) +PKG_CHECK_MODULES(alsa alsa) +PKG_CHECK_MODULES(pulseaudio libpulse libpulse-simple) +INCLUDE(FindThreads) +FIND_PACKAGE(Threads) + IF(alsa_FOUND) + MESSAGE(STATUS "ALSA found ; will compile Audio plugin... (PLUGIN)") + IF(pulseaudio_FOUND) + MESSAGE(STATUS "PulseAudio found ; Audio plugin will have PulseAudio support") + ADD_DEFINITIONS(-DHAVE_PULSE=1) SET(pulse_sources audio-pulse.c) ENDIF(pulseaudio_FOUND) + INCLUDE_DIRECTORIES(${include_dirs} ${alsa_INCLUDE_DIRS} ${pulseaudio_INCLUDE_DIRS}) ADD_LIBRARY(audio-api MODULE audio-api.c audio-alsa.c ${pulse_sources}) - SET_TARGET_PROPERTIES(audio-api PROPERTIES PREFIX "") - TARGET_LINK_LIBRARIES(audio-api ${link_libraries}) - INCLUDE_DIRECTORIES(${include_dirs}) + SET_TARGET_PROPERTIES(audio-api PROPERTIES + PREFIX "" + LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map" + ) + TARGET_LINK_LIBRARIES(audio-api ${link_libraries} ${alsa_LIBRARIES} ${pulseaudio_LIBRARIES}) INSTALL(TARGETS audio-api LIBRARY DESTINATION ${plugin_install_dir}) diff --git a/plugins/audio/audio-api.c b/plugins/audio/audio-api.c index 4eeed92d..8956f809 100644 --- a/plugins/audio/audio-api.c +++ b/plugins/audio/audio-api.c @@ -349,7 +349,7 @@ static const struct AFB_plugin pluginDesc = { } }; -const struct AFB_plugin *pluginAfbV1Entry (const struct AFB_interface *itf) +const struct AFB_plugin *pluginAfbV1Register (const struct AFB_interface *itf) { return &pluginDesc; } diff --git a/plugins/audio/export.map b/plugins/audio/export.map new file mode 100644 index 00000000..e2da85ca --- /dev/null +++ b/plugins/audio/export.map @@ -0,0 +1 @@ +{ global: pluginAfbV1Register; local: *; }; -- cgit 1.2.3-korg