meson: Add optional Gtk+ support
authorArnaud Rebillout <arnaud.rebillout@collabora.com>
Sat, 20 Oct 2018 08:41:28 +0000 (15:41 +0700)
committerArun Raghavan <arun@arunraghavan.net>
Thu, 27 Dec 2018 11:55:56 +0000 (17:25 +0530)
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
meson.build
meson_options.txt
src/meson.build

index 2925fef..1b82597 100644 (file)
@@ -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')
index 85529c4..a5e76f5 100644 (file)
@@ -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)')
index 1ca0282..4279efa 100644 (file)
@@ -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)