From 639c54546d0de717a710d2397cc89946bbbe4280 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sat, 20 Oct 2018 15:41:28 +0700 Subject: [PATCH] meson: Add optional Gtk+ support Signed-off-by: Arnaud Rebillout --- meson.build | 5 +++++ meson_options.txt | 3 +++ src/meson.build | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 2925fef6d..1b825975c 100644 --- a/meson.build +++ b/meson.build @@ -235,6 +235,11 @@ if glib_dep.found() cdata.set('HAVE_GLIB', 1) endif +gtk_dep = dependency('gtk+-3.0', required : get_option('gtk')) +if gtk_dep.found() + cdata.set('HAVE_GTK', 1) +endif + x11_dep = dependency('x11-xcb', required : get_option('x11')) if x11_dep.found() xcb_dep = dependency('xcb', required : true, version : '>= 1.6') diff --git a/meson_options.txt b/meson_options.txt index 85529c4db..a5e76f528 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -41,6 +41,9 @@ option('fftw', option('glib', type : 'feature', value : 'auto', description : 'Optional GLib 2 support') +option('gtk', + type : 'feature', value : 'auto', + description : 'Optional Gtk+ 3 support') option('hal-compat', type : 'boolean', description : 'Optional HAL->udev transition compatibility support (needs udev)') diff --git a/src/meson.build b/src/meson.build index 1ca02822a..4279efaf2 100644 --- a/src/meson.build +++ b/src/meson.build @@ -182,7 +182,7 @@ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor, include_directories : [configinc, topinc], c_args : [pa_c_args], install : true, - dependencies : [libm_dep, thread_dep, shm_dep, sndfile_dep, dbus_dep, x11_dep, systemd_dep, glib_dep], + dependencies : [libm_dep, thread_dep, shm_dep, sndfile_dep, dbus_dep, x11_dep, systemd_dep, glib_dep, gtk_dep], implicit_include_directories : false) libpulsecommon_dep = declare_dependency(link_with: libpulsecommon)