[gnome-boxes/wip/inigomartinez/meson: 3/5] meson: Change build options



commit cd17a4e0b2449cd8d1f7a60b4dc387b1707d8fce
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Sat Dec 9 19:05:45 2017 +0100

    meson: Change build options
    
    Following the new meson porting guidelines, this patch renames the
    build options as follows:
    
    - Remove the 'enable' prefix from boolean options.
    - The character separator in multi-word options has been changed
      to underscore.
    
    The `debug` and `strict-cc` options have also been removed because
    they can be enabled by using meson's options.

 meson.build       |    6 +++---
 meson_options.txt |   14 +++-----------
 src/meson.build   |   14 +++-----------
 3 files changed, 9 insertions(+), 25 deletions(-)
---
diff --git a/meson.build b/meson.build
index 80b2257..260d564 100644
--- a/meson.build
+++ b/meson.build
@@ -50,8 +50,8 @@ data_dir = join_paths (get_option ('prefix'), get_option ('datadir'))
 locale_dir = join_paths (data_dir, '/locale')
 
 conf = configuration_data ()
-conf.set_quoted ('DISTRIBUTOR_NAME', get_option ('distributor-name'))
-conf.set_quoted ('DISTRIBUTOR_VERSION', get_option ('distributor-version'))
+conf.set_quoted ('DISTRIBUTOR_NAME', get_option ('distributor_name'))
+conf.set_quoted ('DISTRIBUTOR_VERSION', get_option ('distributor_version'))
 conf.set_quoted ('PACKAGE_NAME', meson.project_name ())
 conf.set_quoted ('PACKAGE_TARNAME', meson.project_name ())
 conf.set_quoted ('PACKAGE_VERSION', meson.project_version ())
@@ -63,7 +63,7 @@ conf.set_quoted ('LOCALEDIR', locale_dir)
 conf.set('PACKAGE_BUGREPORT', '"https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-boxes";')
 
 if govirt.found()
-  conf.set10 ('HAVE_OVIRT', get_option ('enable-ovirt'))
+  conf.set10 ('HAVE_OVIRT', get_option ('ovirt'))
 endif
 
 configure_file (output: 'config.h', configuration: conf)
diff --git a/meson_options.txt b/meson_options.txt
index aa2ef3f..97c1aad 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,21 +1,13 @@
-option ('distributor-name',
+option ('distributor_name',
         type: 'string',
         value: 'GNOME',
         description: 'Distributor name used in HTTP user agent')
 
-option ('distributor-version',
+option ('distributor_version',
         type: 'string',
         value: '3',
         description: 'Distributor version used in HTTP user agent')
 
-option ('enable-ovirt',
+option ('ovirt',
         type: 'boolean',
         value: true)
-
-option ('enable-debug',
-        type: 'boolean',
-        value: false)
-
-option ('enable-strict-cc',
-        type: 'boolean',
-        value: false)
diff --git a/src/meson.build b/src/meson.build
index 97c9287..d503741 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -77,7 +77,7 @@ vala_sources = [
 ]
 
 if govirt.found ()
-  if get_option ('enable-ovirt')
+  if get_option ('ovirt')
     vala_sources += [
       'ovirt-broker.vala',
       'ovirt-machine.vala',
@@ -106,10 +106,6 @@ vala_args = [
   '--gresources', resource_files,
 ]
 
-if get_option ('enable-debug')
-  vala_args += '-g'
-endif
-
 dependencies = [
   glib,
   gio,
@@ -133,7 +129,7 @@ dependencies = [
 ]
 
 if govirt.found()
-  if get_option ('enable-ovirt')
+  if get_option ('ovirt')
     dependencies += govirt
   endif
 endif
@@ -146,14 +142,10 @@ c_args = [
   '-DG_LOG_DOMAIN="Boxes"',
 ]
 
-if get_option ('enable-debug')
+if get_option('buildtype').contains('debug')
   c_args += ['-O0', '-ggdb3']
 endif
 
-if get_option ('enable-strict-cc')
-  c_args += ['-Wall', '-Werror']
-endif
-
 executable ('gnome-boxes', boxes_sources,
             include_directories: config_h_dir,
             vala_args: vala_args,


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