pipewire/spa/meson.build
George Kiagiadakis 2723b0c6e2 meson: export plugin and data dirs for other projects to find them
SPA_PLUGIN_DIR is exported in pkgconfig as 'plugindir'
PIPEWIRE_MODULE_DIR is exported as 'moduledir'
PIPEWIRE_CONFIG_DIR is exported only in uninstalled environments
as 'confdatadir' (not making this public due to the possible upcoming
configuration changes in pipewire)

All variables are also exported on the meson dependency objects,
so that subprojects can find them.

Wireplumber can then find them like this:

  pipewire_moduledir = pipewire_dep.get_variable(
    pkgconfig: 'moduledir', internal: 'moduledir', default_value: '')

... and this works regardless of whether wireplumber is being
configured as a subproject or using the uninstalled pkgconfig files
or using the system installation of pipewire.

This is required in order to run wireplumber tests in the
uninstalled environment with 'meson test'
2021-06-18 19:24:28 +03:00

63 lines
2.3 KiB
Meson

#project('spa', 'c')
#cc = meson.get_compiler('c')
#dl_lib = cc.find_library('dl', required : false)
#pthread_lib = dependencies('threads')
#mathlib = cc.find_library('m', required : false)
spa_inc = include_directories('include')
subdir('include')
if not get_option('spa-plugins').disabled()
udevrulesdir = get_option('udevrulesdir')
if udevrulesdir == ''
# absolute path, otherwise meson prepends the prefix
udevrulesdir = '/lib/udev/rules.d'
endif
# plugin-specific dependencies
alsa_dep = dependency('alsa', required: get_option('alsa'))
bluez_dep = dependency('bluez', version : '>= 4.101', required: get_option('bluez5'))
if bluez_dep.found()
sbc_dep = dependency('sbc', required: get_option('bluez5'))
ldac_dep = dependency('ldacBT-enc', required : get_option('bluez5-codec-ldac'))
ldac_abr_dep = dependency('ldacBT-abr', required : get_option('bluez5-codec-ldac'))
aptx_dep = dependency('libopenaptx', version : '< 0.2.1', required : get_option('bluez5-codec-aptx'))
fdk_aac_dep = dependency('fdk-aac', required : get_option('bluez5-codec-aac'))
endif
avcodec_dep = dependency('libavcodec', required: get_option('ffmpeg'))
jack_dep = dependency('jack', version : '>= 1.9.10', required: get_option('jack'))
vulkan_dep = dependency('vulkan', disabler : true, version : '>= 1.1.69', required: get_option('vulkan'))
vulkan_headers = cc.has_header('vulkan/vulkan.h', dependencies : vulkan_dep)
libcamera_dep = dependency('camera', required: get_option('libcamera'))
# common dependencies
libudev_dep = dependency('libudev', required: alsa_dep.found() or get_option('udev').enabled() or get_option('v4l2').enabled())
subdir('plugins')
endif
subdir('tools')
subdir('tests')
if not get_option('examples').disabled()
subdir('examples')
endif
spa_dep = declare_dependency(
include_directories : [spa_inc],
version : spaversion,
variables : { 'plugindir' : meson.current_build_dir() / 'plugins' }
)
pkgconfig.generate(filebase : 'lib@0@'.format(spa_name),
name : 'libspa',
subdirs : spa_name,
description : 'Simple Plugin API',
version : spaversion,
extra_cflags : '-D_REENTRANT',
variables : ['plugindir=${libdir}/@0@'.format(spa_name)],
uninstalled_variables : ['plugindir=${prefix}/spa/plugins'],
)
meson.override_dependency('lib@0@'.format(spa_name), spa_dep)