2021-10-18 21:00:08 +10:00
|
|
|
project('media-session', ['c'],
|
2023-01-20 12:04:45 +01:00
|
|
|
version : '0.4.2',
|
2021-05-14 12:09:33 +02:00
|
|
|
license : [ 'MIT', 'LGPL-2.1-or-later', 'GPL-2.0-only' ],
|
2021-10-20 11:51:40 +10:00
|
|
|
meson_version : '>= 0.56.0',
|
2020-04-01 12:51:42 +02:00
|
|
|
default_options : [ 'warning_level=3',
|
2016-09-26 12:15:52 +02:00
|
|
|
'c_std=gnu99',
|
2021-01-14 16:29:32 +01:00
|
|
|
'b_pie=true',
|
2021-09-30 10:01:43 +10:00
|
|
|
#'b_sanitize=address,undefined',
|
2016-09-26 12:15:52 +02:00
|
|
|
'buildtype=debugoptimized' ])
|
|
|
|
|
|
2021-10-13 14:45:23 +10:00
|
|
|
media_session_version = meson.project_version()
|
2016-09-26 12:15:52 +02:00
|
|
|
|
|
|
|
|
prefix = get_option('prefix')
|
2021-10-13 14:45:23 +10:00
|
|
|
media_session_bindir = prefix / get_option('bindir')
|
|
|
|
|
media_session_datadir = prefix / get_option('datadir')
|
|
|
|
|
media_session_libdir = prefix / get_option('libdir')
|
|
|
|
|
media_session_libexecdir = prefix / get_option('libexecdir')
|
|
|
|
|
media_session_localedir = prefix / get_option('localedir')
|
|
|
|
|
media_session_sysconfdir = prefix / get_option('sysconfdir')
|
2020-06-03 11:03:35 +01:00
|
|
|
|
2021-10-19 13:35:30 +10:00
|
|
|
# For historical reasons, we drop our data into the pipewire directories
|
2021-10-13 14:45:23 +10:00
|
|
|
media_session_configdir = media_session_sysconfdir / 'pipewire'
|
|
|
|
|
media_session_confdatadir = media_session_datadir / 'pipewire'
|
2016-11-22 16:50:09 +01:00
|
|
|
|
2016-09-26 12:15:52 +02:00
|
|
|
gnome = import('gnome')
|
2018-09-02 03:22:14 +02:00
|
|
|
pkgconfig = import('pkgconfig')
|
2016-09-26 12:15:52 +02:00
|
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
|
2020-11-28 00:28:47 +01:00
|
|
|
common_flags = [
|
|
|
|
|
'-fvisibility=hidden',
|
|
|
|
|
'-Werror=suggest-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',
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
cc_flags = common_flags + [
|
2021-06-24 11:26:05 +10:00
|
|
|
'-D_GNU_SOURCE',
|
2020-11-28 00:28:47 +01:00
|
|
|
]
|
|
|
|
|
add_project_arguments(cc.get_supported_arguments(cc_flags), language: 'c')
|
|
|
|
|
|
2016-09-26 12:15:52 +02:00
|
|
|
cdata = configuration_data()
|
2021-10-13 14:45:23 +10:00
|
|
|
cdata.set_quoted('MEDIA_SESSION_CONFDATADIR', media_session_confdatadir)
|
|
|
|
|
cdata.set_quoted('LOCALEDIR', media_session_localedir)
|
|
|
|
|
cdata.set_quoted('LIBDIR', media_session_libdir)
|
2021-05-17 16:22:31 +02:00
|
|
|
cdata.set_quoted('GETTEXT_PACKAGE', meson.project_name())
|
2021-10-13 14:45:23 +10:00
|
|
|
cdata.set_quoted('PACKAGE', 'media-session')
|
|
|
|
|
cdata.set_quoted('PACKAGE_NAME', '"media-session"')
|
|
|
|
|
cdata.set_quoted('PACKAGE_STRING', 'media-session @0@'.format(media_session_version))
|
|
|
|
|
cdata.set_quoted('PACKAGE_TARNAME', 'media-session')
|
|
|
|
|
cdata.set_quoted('PACKAGE_URL', '"https://pipewire.org"')
|
|
|
|
|
cdata.set_quoted('PACKAGE_VERSION', media_session_version)
|
2016-09-26 12:15:52 +02:00
|
|
|
|
2023-01-14 21:50:34 +01:00
|
|
|
pipewire_dep = dependency('libpipewire-0.3', version: '>= 0.3.44')
|
2021-10-13 14:45:23 +10:00
|
|
|
|
2021-03-10 15:36:27 -03:00
|
|
|
systemd = dependency('systemd', required: get_option('systemd'))
|
|
|
|
|
systemd_dep = dependency('libsystemd',required: get_option('systemd'))
|
2021-06-25 06:45:51 +03:00
|
|
|
summary({'systemd conf data': systemd.found()}, bool_yn: true)
|
|
|
|
|
summary({'libsystemd': systemd_dep.found()}, bool_yn: true)
|
2021-03-10 15:36:27 -03:00
|
|
|
if systemd.found() and systemd_dep.found()
|
|
|
|
|
cdata.set('HAVE_SYSTEMD', 1)
|
2020-07-22 14:50:38 +02:00
|
|
|
endif
|
|
|
|
|
|
2016-09-26 12:15:52 +02:00
|
|
|
configinc = include_directories('.')
|
2017-06-26 13:04:47 +02:00
|
|
|
|
2016-09-26 12:15:52 +02:00
|
|
|
# Find dependencies
|
2018-01-24 11:56:08 +00:00
|
|
|
mathlib = cc.find_library('m', required : false)
|
|
|
|
|
rt_lib = cc.find_library('rt', required : false) # clock_gettime
|
|
|
|
|
dl_lib = cc.find_library('dl', required : false)
|
|
|
|
|
pthread_lib = dependency('threads')
|
2021-10-14 09:39:48 +10:00
|
|
|
dbus_dep = dependency('dbus-1')
|
2021-06-13 21:52:41 +03:00
|
|
|
|
2021-02-24 17:18:18 +03:00
|
|
|
libinotify_dep = (build_machine.system() == 'freebsd'
|
|
|
|
|
? dependency('libinotify', required: true)
|
|
|
|
|
: dependency('', required: false))
|
|
|
|
|
|
2021-04-23 22:57:51 +03:00
|
|
|
# On FreeBSD, libintl library is required for gettext
|
2021-09-30 23:11:50 +03:00
|
|
|
libintl_dep = dependency('intl', required: false)
|
|
|
|
|
|
|
|
|
|
if not libintl_dep.found()
|
|
|
|
|
libintl_dep = cc.find_library('intl', required: false)
|
|
|
|
|
endif
|
|
|
|
|
summary({'intl support': libintl_dep.found()}, bool_yn: true)
|
2021-04-23 22:57:51 +03:00
|
|
|
|
2021-10-13 14:45:23 +10:00
|
|
|
alsa_dep = dependency('alsa', version : '>=1.1.7')
|
2021-05-27 10:05:19 +10:00
|
|
|
|
2021-01-08 10:26:46 +01:00
|
|
|
subdir('po')
|
2017-07-11 15:57:20 +02:00
|
|
|
subdir('src')
|
2021-10-13 14:45:23 +10:00
|
|
|
subdir('media-session.d')
|
|
|
|
|
if systemd.found()
|
|
|
|
|
subdir('systemd')
|
2021-05-27 10:05:19 +10:00
|
|
|
endif
|
|
|
|
|
|
2021-06-10 13:36:31 +10:00
|
|
|
configure_file(output : 'config.h',
|
|
|
|
|
configuration : cdata)
|
2021-03-10 15:36:27 -03:00
|
|
|
|
|
|
|
|
doxygen = find_program('doxygen', required : get_option('docs'))
|
|
|
|
|
if doxygen.found()
|
|
|
|
|
subdir('doc')
|
2017-05-30 19:46:51 +02:00
|
|
|
endif
|
2017-06-16 17:31:40 +02:00
|
|
|
|
2021-10-20 11:43:39 +10:00
|
|
|
conf_uninstalled = configuration_data()
|
|
|
|
|
conf_uninstalled.set('MESON', '')
|
|
|
|
|
conf_uninstalled.set('MESON_SOURCE_ROOT', meson.project_source_root())
|
|
|
|
|
conf_uninstalled.set('MESON_BUILD_ROOT', meson.project_build_root())
|
|
|
|
|
|
|
|
|
|
ms_uninstalled = configure_file(
|
|
|
|
|
input : 'media-session-uninstalled.sh',
|
|
|
|
|
output : 'media-session-uninstalled.sh.in',
|
|
|
|
|
configuration : conf_uninstalled,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
media_session_uninstalled = custom_target('media-session-uninstalled',
|
|
|
|
|
output : 'media-session-uninstalled.sh',
|
|
|
|
|
input : ms_uninstalled,
|
|
|
|
|
build_by_default : true,
|
|
|
|
|
command : ['cp', '@INPUT@', '@OUTPUT@'],
|
|
|
|
|
)
|
|
|
|
|
|
2021-10-13 14:45:23 +10:00
|
|
|
run_target('media-session-uninstalled',
|
2021-10-20 11:43:39 +10:00
|
|
|
command : [media_session_uninstalled,
|
2021-10-20 11:51:40 +10:00
|
|
|
'-b@0@'.format(meson.project_build_root()),
|
2021-10-13 14:45:23 +10:00
|
|
|
'-v@0@'.format(media_session_version)]
|
2021-10-13 14:37:55 +10:00
|
|
|
)
|
2021-06-04 17:51:12 +02:00
|
|
|
|
|
|
|
|
if meson.version().version_compare('>=0.58.0')
|
|
|
|
|
devenv = environment()
|
|
|
|
|
|
|
|
|
|
builddir = meson.current_build_dir()
|
|
|
|
|
srcdir = meson.current_source_dir()
|
|
|
|
|
|
2021-10-19 17:33:35 +02:00
|
|
|
devenv.set('MEDIA_SESSION_CONFIG_DIR', builddir / 'media-session.d')
|
2021-10-14 21:41:10 +02:00
|
|
|
|
2021-06-04 17:51:12 +02:00
|
|
|
devenv.set('PW_UNINSTALLED', '1')
|
|
|
|
|
|
|
|
|
|
meson.add_devenv(devenv)
|
|
|
|
|
endif
|