2017-05-25 12:22:34 -04:00
|
|
|
project('gvc', 'c',
|
2019-11-22 12:09:21 -05:00
|
|
|
meson_version: '>= 0.42.0',
|
2017-05-25 12:22:34 -04:00
|
|
|
default_options: ['static=true']
|
|
|
|
)
|
|
|
|
|
2018-01-27 03:45:58 -05:00
|
|
|
assert(meson.is_subproject(), 'This project is only intended to be used as a subproject!')
|
2017-05-25 12:22:34 -04:00
|
|
|
|
|
|
|
gnome = import('gnome')
|
|
|
|
|
|
|
|
pkglibdir = get_option('pkglibdir')
|
|
|
|
pkgdatadir = get_option('pkgdatadir')
|
|
|
|
|
|
|
|
cdata = configuration_data()
|
2018-01-27 02:37:41 -05:00
|
|
|
cdata.set_quoted('GETTEXT_PACKAGE', get_option('package_name'))
|
|
|
|
cdata.set_quoted('PACKAGE_VERSION', get_option('package_version'))
|
2017-05-25 12:22:34 -04:00
|
|
|
|
2018-01-27 02:50:05 -05:00
|
|
|
libgvc_gir_headers = [
|
|
|
|
'gvc-channel-map.h',
|
2017-05-25 12:22:34 -04:00
|
|
|
'gvc-mixer-card.h',
|
2018-01-27 02:50:05 -05:00
|
|
|
'gvc-mixer-control.h',
|
|
|
|
'gvc-mixer-event-role.h',
|
|
|
|
'gvc-mixer-sink.h',
|
|
|
|
'gvc-mixer-sink-input.h',
|
|
|
|
'gvc-mixer-source.h',
|
|
|
|
'gvc-mixer-source-output.h',
|
2017-05-25 12:22:34 -04:00
|
|
|
'gvc-mixer-stream.h',
|
2018-01-27 02:50:05 -05:00
|
|
|
'gvc-mixer-ui-device.h'
|
|
|
|
]
|
|
|
|
|
2019-11-22 12:09:21 -05:00
|
|
|
libgvc_enums = gnome.mkenums_simple('gvc-enum-types',
|
|
|
|
sources: libgvc_gir_headers
|
|
|
|
)
|
|
|
|
|
2018-01-27 02:50:05 -05:00
|
|
|
libgvc_gir_sources = [
|
2017-05-25 12:22:34 -04:00
|
|
|
'gvc-channel-map.c',
|
2018-01-27 02:50:05 -05:00
|
|
|
'gvc-mixer-card.c',
|
|
|
|
'gvc-mixer-control.c',
|
|
|
|
'gvc-mixer-event-role.c',
|
2017-05-25 12:22:34 -04:00
|
|
|
'gvc-mixer-sink.c',
|
|
|
|
'gvc-mixer-sink-input.c',
|
2018-01-27 02:50:05 -05:00
|
|
|
'gvc-mixer-source.c',
|
2017-05-25 12:22:34 -04:00
|
|
|
'gvc-mixer-source-output.c',
|
2018-01-27 02:50:05 -05:00
|
|
|
'gvc-mixer-stream.c',
|
|
|
|
'gvc-mixer-ui-device.c'
|
2017-05-25 12:22:34 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
libgvc_no_gir_sources = [
|
|
|
|
'gvc-mixer-card-private.h',
|
|
|
|
'gvc-mixer-stream-private.h',
|
|
|
|
'gvc-channel-map-private.h',
|
|
|
|
'gvc-mixer-control-private.h',
|
|
|
|
'gvc-pulseaudio-fake.h'
|
|
|
|
]
|
|
|
|
|
|
|
|
libgvc_deps = [
|
2018-01-27 02:41:56 -05:00
|
|
|
dependency('gio-2.0'),
|
|
|
|
dependency('gobject-2.0'),
|
2020-04-09 05:50:14 -04:00
|
|
|
dependency('libpulse', version: '>= 12.99.3'),
|
2018-01-27 02:41:56 -05:00
|
|
|
dependency('libpulse-mainloop-glib')
|
2017-05-25 12:22:34 -04:00
|
|
|
]
|
|
|
|
|
2018-01-26 04:08:09 -05:00
|
|
|
enable_alsa = get_option('alsa')
|
|
|
|
if enable_alsa
|
|
|
|
libgvc_deps += dependency('alsa')
|
|
|
|
endif
|
|
|
|
cdata.set('HAVE_ALSA', enable_alsa)
|
|
|
|
|
2018-01-27 02:37:41 -05:00
|
|
|
enable_static = get_option('static')
|
|
|
|
enable_introspection = get_option('introspection')
|
2017-05-25 12:22:34 -04:00
|
|
|
|
2018-01-27 03:45:58 -05:00
|
|
|
assert(not enable_static or not enable_introspection, 'Currently meson requires a shared library for building girs.')
|
|
|
|
assert(enable_static or pkglibdir != '', 'Installing shared library, but pkglibdir is unset!')
|
2017-05-25 12:22:34 -04:00
|
|
|
|
|
|
|
c_args = ['-DG_LOG_DOMAIN="Gvc"']
|
|
|
|
|
2018-01-27 02:37:41 -05:00
|
|
|
if enable_introspection
|
2017-05-25 12:22:34 -04:00
|
|
|
c_args += '-DWITH_INTROSPECTION'
|
|
|
|
endif
|
|
|
|
|
2018-01-27 02:37:41 -05:00
|
|
|
if enable_static
|
2017-05-25 12:22:34 -04:00
|
|
|
libgvc_static = static_library('gvc',
|
2019-11-22 12:09:21 -05:00
|
|
|
sources: libgvc_gir_sources + libgvc_no_gir_sources + libgvc_enums,
|
2017-05-25 12:22:34 -04:00
|
|
|
dependencies: libgvc_deps,
|
|
|
|
c_args: c_args
|
|
|
|
)
|
|
|
|
|
|
|
|
libgvc = libgvc_static
|
|
|
|
else
|
|
|
|
if pkglibdir == ''
|
|
|
|
error('Installing shared library, but pkglibdir is unset!')
|
|
|
|
endif
|
|
|
|
|
|
|
|
libgvc_shared = shared_library('gvc',
|
2019-11-22 12:09:21 -05:00
|
|
|
sources: libgvc_gir_sources + libgvc_no_gir_sources + libgvc_enums,
|
2017-05-25 12:22:34 -04:00
|
|
|
dependencies: libgvc_deps,
|
|
|
|
c_args: c_args,
|
|
|
|
install_dir: pkglibdir,
|
|
|
|
install: true
|
|
|
|
)
|
|
|
|
|
|
|
|
libgvc = libgvc_shared
|
|
|
|
endif
|
|
|
|
|
2018-01-27 02:37:41 -05:00
|
|
|
if enable_introspection
|
2018-01-27 03:45:58 -05:00
|
|
|
assert(pkgdatadir != '', 'Installing introspection, but pkgdatadir is unset!')
|
2017-05-25 12:22:34 -04:00
|
|
|
|
|
|
|
libgvc_gir = gnome.generate_gir(libgvc,
|
2019-11-22 12:09:21 -05:00
|
|
|
sources: libgvc_gir_sources + libgvc_gir_headers + libgvc_enums,
|
2017-05-25 12:22:34 -04:00
|
|
|
nsversion: '1.0',
|
|
|
|
namespace: 'Gvc',
|
|
|
|
includes: ['Gio-2.0', 'GObject-2.0'],
|
|
|
|
extra_args: ['-DWITH_INTROSPECTION', '--quiet'],
|
|
|
|
install_dir_gir: pkgdatadir,
|
|
|
|
install_dir_typelib: pkglibdir,
|
|
|
|
install: true
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2018-01-26 04:08:09 -05:00
|
|
|
if enable_alsa
|
2017-05-25 12:22:34 -04:00
|
|
|
executable('test-audio-device-selection',
|
|
|
|
sources: 'test-audio-device-selection.c',
|
|
|
|
link_with: libgvc,
|
|
|
|
dependencies: libgvc_deps,
|
|
|
|
c_args: c_args
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
|
|
|
libgvc_dep = declare_dependency(
|
|
|
|
link_with: libgvc,
|
2018-01-27 03:49:17 -05:00
|
|
|
include_directories: include_directories('.'),
|
2017-07-28 13:36:11 -04:00
|
|
|
dependencies: libgvc_deps
|
2017-05-25 12:22:34 -04:00
|
|
|
)
|
2018-01-26 04:08:09 -05:00
|
|
|
|
2018-01-27 03:53:08 -05:00
|
|
|
configure_file(
|
2018-01-26 04:08:09 -05:00
|
|
|
output: 'config.h',
|
|
|
|
configuration: cdata
|
|
|
|
)
|