[gssdp/wip/meson: 13/17] meson: Clean-up configure options



commit fe3c98313d24c11b07571bcc73d76365194b3ea2
Author: Jens Georg <mail jensge org>
Date:   Fri Oct 26 16:43:47 2018 +0200

    meson: Clean-up configure options

 libgssdp/meson.build |  2 +-
 meson.build          | 25 +++++--------------------
 meson_options.txt    |  8 ++++----
 3 files changed, 10 insertions(+), 25 deletions(-)
---
diff --git a/libgssdp/meson.build b/libgssdp/meson.build
index 2119802..0308388 100644
--- a/libgssdp/meson.build
+++ b/libgssdp/meson.build
@@ -67,7 +67,7 @@ pkg.generate(libraries: [ libgssdp ],
              description: 'GObject-based SSDP library',
              requires_private: ['gobject-2.0', 'gio-2.0'])
 
-if introspection_available
+if get_option('introspection')
     gir = gnome.generate_gir(libgssdp,
             sources : introspection_sources,
             namespace : 'GSSDP',
diff --git a/meson.build b/meson.build
index b8112ad..bc1e8ac 100644
--- a/meson.build
+++ b/meson.build
@@ -2,13 +2,6 @@ project('GSSDP', 'c', version: '1.1.0')
 gnome = import('gnome')
 pkg = import('pkgconfig')
 
-as_version = meson.project_version() # set in project() below
-ver_arr = as_version.split('.')
-
-as_major_version = ver_arr[0]
-as_minor_version = ver_arr[1]
-as_micro_version = ver_arr[2]
-
 cc = meson.get_compiler('c')
 
 conf = configuration_data()
@@ -81,26 +74,18 @@ gobject_dep = dependency('gobject-2.0', version : '>= 2.32')
 gio_dep = dependency('gio-2.0', version : '>= 2.32')
 soup_dep = dependency('libsoup-2.4', version : '>= 2.26.1')
 
-if not get_option('without-gtk')
-  gtk = dependency('gtk+-3.0', version : '>= 3.12', required: false)
-endif
-
-gir = find_program('g-ir-scanner', required: false)
-vapigen = find_program('vapigen', required: false)
-
-introspection_available = gir.found() and not get_option('disable-introspection')
-vapi_available = introspection_available and vapigen.found() and not get_option('disable-vala')
-
 subdir('libgssdp')
 subdir('tests')
-if not get_option('without-gtk') and gtk.found()
+
+if get_option('sniffer')
+  gtk = dependency('gtk+-3.0', version : '>= 3.12')
   subdir('tools')
 endif
 
-if vapi_available
+if get_option('vapi') and get_option('introspection')
   subdir('vala')
 endif
 
-if get_option('enable-gtk-doc')
+if get_option('gtk_doc')
   subdir('doc')
 endif
diff --git a/meson_options.txt b/meson_options.txt
index 2dc4b33..72816c9 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,4 +1,4 @@
-option('enable-gtk-doc', type: 'boolean', value: false, description: 'Enable generating the API reference 
(depends on GTK-Doc)')
-option('without-gtk', type: 'boolean', value: false, description: 'Compile without GTK+ support')
-option('disable-introspection', type: 'boolean', value : false, description: 'Disable GObject Introspection')
-option('disable-vala', type: 'boolean', value: false, description: 'Disable generation of vala vapi file')
+option('gtk_doc', type: 'boolean', value: false, description: 'Enable generating the API reference (depends 
on GTK-Doc)')
+option('sniffer', type: 'boolean', value: true, description: 'Compile graphical SSDP sniffer')
+option('introspection', type: 'boolean', value : true, description: 'Enable or disable GObject 
Introspection')
+option('vapi', type: 'boolean', value: true, description: 'Enable or disable generation of Vala vapi file')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]