meson: Define HAVE_PULSE_MESSAGING_API when available

To match the autotools build.
This commit is contained in:
Jan Alexander Steffens (heftig) 2022-04-13 15:59:56 +00:00
parent 964f2987a4
commit 8f04dad2c0
2 changed files with 18 additions and 2 deletions

View File

@ -6,6 +6,8 @@ project('pavucontrol', 'cpp',
with_lynx = get_option('lynx')
cpp = meson.get_compiler('cpp')
gtkmm_dep = dependency('gtkmm-3.0', version : '>= 3.0', required : true)
sigcpp_dep = dependency('sigc++-2.0', required : true)
canberragtk_dep = dependency('libcanberra-gtk3', version : '>= 0.16', required : true)
@ -13,6 +15,12 @@ canberragtk_dep = dependency('libcanberra-gtk3', version : '>= 0.16', required :
libpulse_dep = dependency('libpulse', version : '>= 5.0', required : true)
libpulsemlglib_dep = dependency('libpulse-mainloop-glib', version : '>= 0.9.16', required : true)
have_pulse_messaging_api = cpp.has_function('pa_context_send_message_to_object',
dependencies: [libpulse_dep],
)
json_glib_dep = dependency('json-glib-1.0', required : have_pulse_messaging_api)
lynx = find_program('lynx', required: with_lynx)
tidy = find_program('tidy', required: false)

View File

@ -14,12 +14,20 @@ pavucontrol_sources = [
'streamwidget.cc',
]
pavucontrol_deps = [gtkmm_dep, sigcpp_dep, canberragtk_dep, libpulse_dep, libpulsemlglib_dep]
pavucontrol_defines = ['-DHAVE_CONFIG_H']
if have_pulse_messaging_api
pavucontrol_deps += [json_glib_dep]
pavucontrol_defines += ['-DHAVE_PULSE_MESSAGING_API']
endif
executable('pavucontrol',
pavucontrol_sources,
install: true,
cpp_args: ['-DHAVE_CONFIG_H'],
cpp_args: pavucontrol_defines,
include_directories : configinc,
dependencies : [gtkmm_dep, sigcpp_dep, canberragtk_dep, libpulse_dep, libpulsemlglib_dep],
dependencies : pavucontrol_deps,
)
install_data('pavucontrol.glade')