Skip to content

Commit

Permalink
meson: add support for plugins
Browse files Browse the repository at this point in the history
Change-Id: I767d7baa288edeeb93ceb16d6f2bbfff2b48d5c9
Reviewed-by: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
  • Loading branch information
H5117 authored and Sébastien Blin committed Jun 25, 2020
1 parent e1e3a39 commit 4ad81ca
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 16 deletions.
18 changes: 18 additions & 0 deletions bin/dbus/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ if conf.get('ENABLE_VIDEO')
)
endif

if conf.get('ENABLE_PLUGIN')
jamid_targets += custom_target('pluginmanagerinterface.adaptor',
command: [progdbusxxxml2cpp, '@INPUT@', '--adaptor=@OUTPUT@'],
input: 'cx.ring.Ring.PluginManagerInterface.xml',
output: 'dbuspluginmanagerinterface.adaptor.h'
)

jamid_sources += files(
'dbuspluginmanagerinterface.cpp'
)
endif

if progpod2man.found()
jamid_targets += custom_target('jamid.man',
command: [progpod2man, '--section=8', '--release='+meson.project_version(), '--center', '""', '@INPUT@', '@OUTPUT@'],
Expand Down Expand Up @@ -91,3 +103,9 @@ if conf.get('ENABLE_VIDEO')
install_dir: get_option('datadir') / 'dbus-1' / 'interfaces'
)
endif
if conf.get('ENABLE_PLUGIN')
install_data(
'cx.ring.Ring.PluginManagerInterface.xml',
install_dir: get_option('datadir') / 'dbus-1' / 'interfaces'
)
endif
34 changes: 19 additions & 15 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('jami-daemon', ['c', 'cpp'],
version: '9.1.0',
version: '9.2.0',
license: 'GPL3+',
default_options: ['cpp_std=gnu++14', 'buildtype=debugoptimized'],
meson_version:'>= 0.54'
Expand Down Expand Up @@ -38,20 +38,6 @@ if not depyamlcpp.found()
]).dependency('yaml-cpp')
endif

deplibarchive = dependency('libarchive', version: '>= 3.4.0', required: false)
if not deplibarchive.found()
deplibarchive = modcmake.subproject('libarchive', cmake_options: [
'-DCMAKE_BUILD_TYPE=Release',
'-DCMAKE_INSTALL_LIBDIR=lib',
'-DCMAKE_POSITION_INDEPENDENT_CODE=ON',
'-DENABLE_TEST=OFF',
'-DENABLE_TAR=OFF',
'-DENABLE_CPIO=OFF',
'-DENABLE_CAT=OFF',
'-DENABLE_LIBXML2=OFF'
]).dependency('archive_static')
endif

depjsoncpp = dependency('jsoncpp', version: '>= 1.6.5',
fallback: ['jsoncpp', 'jsoncpp_dep'], default_options: ['default_library=static'])
depzlib = dependency('zlib', fallback: ['zlib', 'zlib_dep'], default_options: ['default_library=static'])
Expand Down Expand Up @@ -130,6 +116,24 @@ if get_option('video')
endif
endif

if get_option('plugins')
conf.set('ENABLE_PLUGIN', true)
deplibarchive = dependency('libarchive', version: '>= 3.4.0', required: false)
if not deplibarchive.found()
deplibarchive = modcmake.subproject('libarchive', cmake_options: [
'-DCMAKE_BUILD_TYPE=Release',
'-DCMAKE_POSITION_INDEPENDENT_CODE=ON',
'-DENABLE_TEST=OFF',
'-DENABLE_TAR=OFF',
'-DENABLE_CPIO=OFF',
'-DENABLE_CAT=OFF',
'-DENABLE_LIBXML2=OFF'
]).dependency('archive_static')
endif
else
conf.set('ENABLE_PLUGIN', false)
endif

conf.set10('HAVE_COREAUDIO', host_machine.system() == 'darwin')
conf.set10('HAVE_SHM', host_machine.system() == 'linux' and meson.get_compiler('cpp').get_define('__ANDROID__') != '1')

Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
option('interfaces', type: 'array', choices: ['library', 'dbus', 'nodejs'], value: ['library'])
option('video', type: 'boolean', value: true, description: 'Enable video support')
option('hw_acceleration', type: 'boolean', value: true, description: 'Enable hardware acceleration')
option('plugins', type: 'boolean', value: true, description: 'Enable support for plugins')

option('name_service', type: 'feature', value: 'auto', description: 'Enable Name Service')
option('opensl', type: 'feature', value: 'auto', description: 'Enable support for OpenSL')
Expand Down
17 changes: 16 additions & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ libjami_dependencies = [
depspeex,
depspeexdsp,
depyamlcpp,
deplibarchive,
depjsoncpp,
depzlib
]
Expand Down Expand Up @@ -261,6 +260,16 @@ if conf.get('ENABLE_VIDEO')
endif
endif

if conf.get('ENABLE_PLUGIN')
libjami_sources += files(
'client/plugin_manager_interface.cpp',
'plugin/jamipluginmanager.cpp',
'plugin/pluginloaderdl.cpp',
'plugin/pluginmanager.cpp'
)
libjami_dependencies += deplibarchive
endif

libjami = library('jami',
version: meson.project_version(),
include_directories: libjami_includedirs,
Expand Down Expand Up @@ -296,6 +305,12 @@ if get_option('interfaces').contains('library')
subdir: 'dring'
)
endif
if conf.get('ENABLE_PLUGIN')
install_headers(
'dring/plugin_manager_interface.h',
subdir: 'dring'
)
endif

modpkgconfig.generate(
libjami,
Expand Down

0 comments on commit 4ad81ca

Please sign in to comment.