2021-02-03 17:18:41 +02:00
|
|
|
project('wireplumber', ['c'],
|
2024-02-14 18:40:30 +02:00
|
|
|
version : '0.4.82',
|
2019-05-31 12:13:01 +03:00
|
|
|
license : 'MIT',
|
2022-05-10 15:10:52 +03:00
|
|
|
meson_version : '>= 0.59.0',
|
2019-04-03 18:31:05 +03:00
|
|
|
default_options : [
|
|
|
|
|
'warning_level=1',
|
2019-09-05 10:11:26 -04:00
|
|
|
'buildtype=debugoptimized',
|
2019-04-03 18:31:05 +03:00
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
|
2023-05-19 20:20:35 +03:00
|
|
|
wireplumber_api_version = '0.5'
|
2019-05-29 12:47:26 +03:00
|
|
|
wireplumber_so_version = '0'
|
|
|
|
|
|
2021-05-06 12:15:52 +03:00
|
|
|
wireplumber_headers_dir = get_option('includedir') / 'wireplumber-' + wireplumber_api_version / 'wp'
|
2020-06-02 18:26:40 +03:00
|
|
|
|
2021-07-06 09:40:39 +10:00
|
|
|
wireplumber_bin_dir = get_option('prefix') / get_option('bindir')
|
|
|
|
|
wireplumber_module_dir = get_option('prefix') / get_option('libdir') / 'wireplumber-' + wireplumber_api_version
|
2023-03-27 15:05:40 -04:00
|
|
|
wireplumber_data_dir = get_option('prefix') / get_option('datadir') / 'wireplumber'
|
|
|
|
|
wireplumber_config_dir = get_option('prefix') / get_option('sysconfdir') / 'wireplumber'
|
2022-04-09 13:43:53 +03:00
|
|
|
wireplumber_locale_dir = get_option('prefix') / get_option('localedir')
|
2023-11-15 14:58:34 +02:00
|
|
|
wireplumber_doc_dir = get_option('prefix') / get_option('datadir') / 'doc' / 'wireplumber'
|
2021-02-01 17:44:57 +02:00
|
|
|
|
2021-04-09 15:50:17 +03:00
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
|
2023-06-15 21:27:13 +03:00
|
|
|
glib_req_version = '>= 2.68'
|
2021-06-15 12:00:43 +03:00
|
|
|
add_project_arguments([
|
2023-06-15 21:27:13 +03:00
|
|
|
'-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_68',
|
|
|
|
|
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_68',
|
2021-06-15 12:00:43 +03:00
|
|
|
], language: 'c'
|
|
|
|
|
)
|
|
|
|
|
|
2022-05-10 15:10:52 +03:00
|
|
|
add_project_arguments([
|
|
|
|
|
'-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),
|
|
|
|
|
], language: 'c'
|
|
|
|
|
)
|
|
|
|
|
|
2022-11-16 11:29:13 +01:00
|
|
|
build_modules = get_option('modules')
|
|
|
|
|
build_daemon = get_option('daemon')
|
|
|
|
|
if build_daemon and not build_modules
|
|
|
|
|
error('\'modules\' option is required to be true when the \'daemon\' option is true')
|
|
|
|
|
endif
|
|
|
|
|
build_tools = get_option('tools')
|
|
|
|
|
if build_tools and not build_modules
|
|
|
|
|
error('\'modules\' option is required to be true when the \'tools\' option is enabled')
|
|
|
|
|
endif
|
|
|
|
|
|
2021-04-20 04:08:58 -04:00
|
|
|
glib_dep = dependency('glib-2.0', version : glib_req_version)
|
2021-02-25 16:58:47 +02:00
|
|
|
gobject_dep = dependency('gobject-2.0', version : glib_req_version)
|
|
|
|
|
gmodule_dep = dependency('gmodule-2.0', version : glib_req_version)
|
|
|
|
|
gio_dep = dependency('gio-2.0', version : glib_req_version)
|
|
|
|
|
giounix_dep = dependency('gio-unix-2.0', version : glib_req_version)
|
2021-04-20 04:08:58 -04:00
|
|
|
spa_dep = dependency('libspa-0.2', version: '>= 0.2')
|
2023-10-19 21:44:08 +03:00
|
|
|
pipewire_dep = dependency('libpipewire-0.3', version: '>= 0.3.75')
|
2021-04-09 15:50:17 +03:00
|
|
|
mathlib = cc.find_library('m')
|
2021-05-06 13:00:55 +03:00
|
|
|
threads_dep = dependency('threads')
|
2022-05-10 15:10:52 +03:00
|
|
|
libintl_dep = dependency('intl')
|
2019-04-03 18:31:05 +03:00
|
|
|
|
2022-11-16 11:29:13 +01:00
|
|
|
if build_modules
|
|
|
|
|
system_lua = get_option('system-lua')
|
|
|
|
|
if system_lua
|
|
|
|
|
if get_option('system-lua-version') != 'auto'
|
|
|
|
|
lua_version_requested = get_option('system-lua-version')
|
|
|
|
|
lua_dep = dependency('lua-' + lua_version_requested, required: false)
|
|
|
|
|
if not lua_dep.found()
|
|
|
|
|
lua_dep = dependency('lua' + lua_version_requested, required: false)
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
if not lua_dep.found()
|
|
|
|
|
error('Specified Lua version "' + lua_version_requested + '" not found')
|
|
|
|
|
endif
|
|
|
|
|
else
|
|
|
|
|
lua_dep = dependency('lua-5.4', required: false)
|
|
|
|
|
if not lua_dep.found()
|
|
|
|
|
lua_dep = dependency('lua5.4', required: false)
|
|
|
|
|
endif
|
|
|
|
|
if not lua_dep.found()
|
|
|
|
|
lua_dep = dependency('lua54', required: false)
|
|
|
|
|
endif
|
|
|
|
|
if not lua_dep.found()
|
|
|
|
|
lua_dep = dependency('lua-5.3', required: false)
|
|
|
|
|
endif
|
|
|
|
|
if not lua_dep.found()
|
|
|
|
|
lua_dep = dependency('lua5.3', required: false)
|
|
|
|
|
endif
|
|
|
|
|
if not lua_dep.found()
|
|
|
|
|
lua_dep = dependency('lua53', required: false)
|
|
|
|
|
endif
|
|
|
|
|
if not lua_dep.found()
|
|
|
|
|
lua_dep = dependency('lua', version: ['>=5.3.0'], required: false)
|
|
|
|
|
endif
|
|
|
|
|
if not lua_dep.found()
|
|
|
|
|
error ('Could not find lua. Lua version 5.4 or 5.3 required')
|
|
|
|
|
endif
|
2021-07-27 21:04:59 +02:00
|
|
|
endif
|
|
|
|
|
else
|
2022-11-16 11:29:13 +01:00
|
|
|
lua_proj = subproject('lua', default_options: ['default_library=static'])
|
|
|
|
|
lua_dep = lua_proj.get_variable('lua_dep')
|
2021-01-23 19:11:38 +02:00
|
|
|
endif
|
2022-11-16 11:29:13 +01:00
|
|
|
summary({'Lua version': lua_dep.version() + (system_lua ? ' (system)' : ' (built-in)')})
|
2020-12-01 10:53:48 +02:00
|
|
|
endif
|
|
|
|
|
|
2022-11-16 11:29:13 +01:00
|
|
|
if build_modules
|
|
|
|
|
systemd = dependency('systemd', required: get_option('systemd'))
|
|
|
|
|
libsystemd_dep = dependency('libsystemd',required: get_option('systemd'))
|
|
|
|
|
libelogind_dep = dependency('libelogind', required: get_option('elogind'))
|
|
|
|
|
summary({'systemd conf data': systemd.found(),
|
|
|
|
|
'libsystemd': libsystemd_dep.found(),
|
|
|
|
|
'libelogind': libelogind_dep.found()}, bool_yn: true)
|
|
|
|
|
endif
|
2021-09-27 18:01:11 +03:00
|
|
|
|
2019-04-10 12:32:51 +03:00
|
|
|
gnome = import('gnome')
|
2019-12-12 20:19:19 +02:00
|
|
|
pkgconfig = import('pkgconfig')
|
2021-06-09 11:46:24 +03:00
|
|
|
fs = import('fs')
|
2019-04-10 12:32:51 +03:00
|
|
|
|
2019-04-16 15:42:10 +03:00
|
|
|
wp_lib_include_dir = include_directories('lib')
|
|
|
|
|
|
2020-12-20 22:12:11 +02:00
|
|
|
common_flags = [
|
|
|
|
|
'-fvisibility=hidden',
|
|
|
|
|
'-Wsuggest-attribute=format',
|
|
|
|
|
'-Wsign-compare',
|
|
|
|
|
'-Wpointer-arith',
|
|
|
|
|
'-Wpointer-sign',
|
|
|
|
|
'-Wformat',
|
|
|
|
|
'-Wformat-security',
|
|
|
|
|
'-Wimplicit-fallthrough',
|
|
|
|
|
'-Wmissing-braces',
|
|
|
|
|
'-Wtype-limits',
|
|
|
|
|
'-Wvariadic-macros',
|
|
|
|
|
'-Wno-missing-field-initializers',
|
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
|
'-Wno-pedantic',
|
|
|
|
|
'-Wold-style-declaration',
|
|
|
|
|
'-Wunused-result',
|
|
|
|
|
]
|
|
|
|
|
add_project_arguments(cc.get_supported_arguments(common_flags), language: 'c')
|
2020-01-16 18:50:07 +02:00
|
|
|
|
2019-04-10 12:32:51 +03:00
|
|
|
subdir('lib')
|
2022-11-16 11:29:13 +01:00
|
|
|
if build_modules
|
|
|
|
|
subdir('modules')
|
|
|
|
|
endif
|
2020-11-15 19:14:21 +02:00
|
|
|
subdir('src')
|
2022-04-09 13:43:53 +03:00
|
|
|
subdir('po')
|
2023-12-13 16:31:50 +02:00
|
|
|
subdir('docs')
|
2021-09-14 05:07:41 +01:00
|
|
|
|
|
|
|
|
if get_option('tests')
|
|
|
|
|
subdir('tests')
|
|
|
|
|
endif
|
2021-10-13 11:01:53 +10:00
|
|
|
|
2022-07-22 21:01:48 +02:00
|
|
|
builddir = meson.project_build_root()
|
|
|
|
|
srcdir = meson.project_source_root()
|
|
|
|
|
|
2021-10-13 11:01:53 +10:00
|
|
|
conf_uninstalled = configuration_data()
|
|
|
|
|
conf_uninstalled.set('MESON', '')
|
2022-07-22 21:01:48 +02:00
|
|
|
conf_uninstalled.set('MESON_SOURCE_ROOT', srcdir)
|
|
|
|
|
conf_uninstalled.set('MESON_BUILD_ROOT', builddir)
|
2021-10-13 11:01:53 +10:00
|
|
|
|
|
|
|
|
wp_uninstalled = configure_file(
|
|
|
|
|
input : 'wp-uninstalled.sh',
|
|
|
|
|
output : 'wp-uninstalled.sh.in',
|
|
|
|
|
configuration : conf_uninstalled,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
wireplumber_uninstalled = custom_target('wp-uninstalled',
|
|
|
|
|
output : 'wp-uninstalled.sh',
|
|
|
|
|
input : wp_uninstalled,
|
|
|
|
|
build_by_default : true,
|
|
|
|
|
command : ['cp', '@INPUT@', '@OUTPUT@'],
|
|
|
|
|
)
|
2021-12-15 14:11:58 +01:00
|
|
|
|
2022-07-22 21:01:48 +02:00
|
|
|
devenv = environment({
|
|
|
|
|
'WIREPLUMBER_MODULE_DIR': builddir / 'modules',
|
2023-11-03 03:24:23 +01:00
|
|
|
'WIREPLUMBER_CONFIG_DIR': srcdir / 'src' / 'config',
|
2022-07-22 21:01:48 +02:00
|
|
|
'WIREPLUMBER_DATA_DIR': srcdir / 'src',
|
|
|
|
|
})
|
2021-12-15 14:11:58 +01:00
|
|
|
|
2022-07-22 21:01:48 +02:00
|
|
|
meson.add_devenv(devenv)
|