[network-manager-applet/wip/inigomartinez/meson-improvements: 3/7] build(meson): Rename build options



commit b3629d9fa646a1941f2c3cb8fa1d2c6ab501cb3b
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Fri Nov 10 17:33:13 2017 +0100

    build(meson): Rename build options
    
    Following the new meson porting guidelines, this patch renames the
    build options. The list of changes is as follows:
    
    - Remove the enable prefix from boolean options.
    - Remove the with prefix from string options.
    - The character separator from multi-word options has been changed
      to underscore.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790178

 meson.build       |   36 ++++++++++++++++++------------------
 meson_options.txt |   22 +++++++++++-----------
 2 files changed, 29 insertions(+), 29 deletions(-)
---
diff --git a/meson.build b/meson.build
index 780c3cd..887020a 100644
--- a/meson.build
+++ b/meson.build
@@ -132,7 +132,7 @@ endforeach
 common_flags = ['-DHAVE_CONFIG_H']
 common_ldflags = []
 
-enable_ld_gc = get_option('enable-ld-gc')
+enable_ld_gc = get_option('ld_gc')
 if enable_ld_gc
   test_cflags = [
     '-fdata-sections',
@@ -142,7 +142,7 @@ if enable_ld_gc
   test_ldflags = ['-Wl,--gc-sections']
 
   foreach cflag: test_cflags + test_ldflags
-    assert(cc.has_argument(cflag), 'Unused symbol eviction requested but not supported. Use 
-Denable-ld-gc=false to build without it.')
+    assert(cc.has_argument(cflag), 'Unused symbol eviction requested but not supported. Use -Dld_gc=false to 
build without it.')
   endforeach
 
   common_flags += test_cflags
@@ -188,13 +188,13 @@ have_version_script = host_machine.system().contains('linux') and cc.has_argumen
 linker_script_ver = join_paths(meson.source_root(), 'linker-script-binary.ver')
 
 # Check for iso-codes for country names translation
-enable_iso_codes = get_option('enable-iso-codes')
+enable_iso_codes = get_option('iso_codes')
 message('whether to disable iso-codes at build-time: ' + enable_iso_codes.to_string())
 if enable_iso_codes
   iso_codes_dep = dependency('iso-codes')
 
   str = 'Consider installing the package or adjusting the PKG_CONFIG_PATH environment variable.\n'
-  str += 'You can also disable build-time check for \'iso-codes\' via -Denable-iso-codes=false'
+  str += 'You can also disable build-time check for \'iso-codes\' via -Diso_codes=false'
   assert(iso_codes_dep.found(), str)
 
   iso_3166 = iso_codes_dep.get_pkgconfig_variable('domains').contains('iso_3166')
@@ -251,7 +251,7 @@ libnm_dep = declare_dependency(
   compile_args: cflags
 )
 
-enable_libnm_gtk = get_option('enable-libnm-gtk')
+enable_libnm_gtk = get_option('libnm_gtk')
 if enable_libnm_gtk
   deps = [
     gio_dep,
@@ -275,7 +275,7 @@ if enable_libnm_gtk
   )
 endif
 
-enable_appindicator = get_option('enable-appindicator')
+enable_appindicator = get_option('appindicator')
 if enable_appindicator
   appindicator_dep = dependency('appindicator3-0.1')
   dbusmenu_dep = dependency('dbusmenu-gtk3-0.4', version: '>= 16.04.0')
@@ -283,31 +283,31 @@ endif
 config_h.set('WITH_APPINDICATOR', enable_appindicator)
 
 # ModemManager1 with libmm-glib for WWAN support
-enable_wwan = get_option('enable-wwan')
+enable_wwan = get_option('wwan')
 if enable_wwan
   mm_glib_dep = dependency('mm-glib', required: false)
-  assert(mm_glib_dep.found(), 'libmm-glib is needed for WWAN support. Use -Denable-wwan=false to build 
without it.')
+  assert(mm_glib_dep.found(), 'libmm-glib is needed for WWAN support. Use -Dwwan=false to build without it.')
 endif
 config_h.set10('WITH_WWAN', enable_wwan)
 
 # SELinux
-enable_selinux = get_option('enable-selinux')
+enable_selinux = get_option('selinux')
 if enable_selinux
   libselinux_dep = dependency('libselinux', required: false)
-  assert(libselinux_dep.found(), 'libselinux is needed for SELinux label support in configuration editor. 
Use -Denable-selinux=false to build without it.')
+  assert(libselinux_dep.found(), 'libselinux is needed for SELinux label support in configuration editor. 
Use -Dselinux=false to build without it.')
 endif
 config_h.set10('WITH_SELINUX', enable_selinux)
 
 # Jansson for team configuration editing
-enable_team = get_option('enable-team')
+enable_team = get_option('team')
 if enable_team
   jansson_dep = dependency('jansson', version: '>= 2.7', required: false)
-  assert(jansson_dep.found(), 'jansson is needed for team configuration editor. Use -Denable-team=false to 
build without it.')
+  assert(jansson_dep.found(), 'jansson is needed for team configuration editor. Use -Dteam=false to build 
without it.')
 endif
 config_h.set10('WITH_JANSSON', enable_team)
 
 # GCR for PKCS#11 enabled certificate chooser
-enable_gcr = get_option('enable-gcr')
+enable_gcr = get_option('gcr')
 if enable_gcr
   deps = [
     dependency('gcr-3', version: '>= 3.14'),
@@ -369,7 +369,7 @@ if enable_gcr
     GcrCertificate *gcr_simple_certificate_new (const guchar *data, gsize n_data);
   '''
 
-  assert(cc.compiles(gcr_src, dependencies: deps), 'gcr support was requested, but the gcr library is not 
available. Use -Denable-gcr=false to build without it.')
+  assert(cc.compiles(gcr_src, dependencies: deps), 'gcr support was requested, but the gcr library is not 
available. Use -Dgcr=false to build without it.')
 
   gcr_dep = declare_dependency(
     dependencies: deps,
@@ -379,13 +379,13 @@ endif
 config_h.set10('WITH_GCR', enable_gcr)
 
 # introspection support
-enable_introspection = get_option('enable-introspection')
+enable_introspection = get_option('introspection')
 if enable_introspection
   gir_dep = dependency('gobject-introspection-1.0', version: '>= 0.9.6', required: false)
-  assert(gir_dep.found(), 'introspection support was requested, but the gobject-introspection library is not 
available. Use -Denable-introspection=false to build without it.')
+  assert(gir_dep.found(), 'introspection support was requested, but the gobject-introspection library is not 
available. Use -Dintrospection=false to build without it.')
 endif
 
-more_asserts = get_option('with-more-asserts')
+more_asserts = get_option('more_asserts')
 if more_asserts == 'no'
   more_asserts = 0
 elif more_asserts == 'yes'
@@ -481,7 +481,7 @@ install_data(
 )
 
 # documentation
-enable_gtk_doc = get_option('enable-gtk-doc')
+enable_gtk_doc = get_option('gtk_doc')
 if enable_gtk_doc
   mod_name = 'libnma'
 
diff --git a/meson_options.txt b/meson_options.txt
index 556da56..666dfe3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,11 +1,11 @@
-option('enable-libnm-gtk', type: 'boolean', value: true, description: 'build legacy library libnm-gtk which 
depends on libnm-glib/libnm-util/dbus-glib')
-option('enable-appindicator', type: 'boolean', value: false, description: 'Build with libappindicator 
support instead of xembed systray support.')
-option('enable-wwan', type: 'boolean', value: true, description: 'Enable WWAN support.')
-option('enable-selinux', type: 'boolean', value: true, description: 'Enable support for adjusting SELinux 
labels in configuration editor.')
-option('enable-team', type: 'boolean', value: true, description: 'Enable team configuration editor.')
-option('enable-gcr', type: 'boolean', value: true, description: 'Enable advanced certificate chooser.')
-option('with-more-asserts', type: 'string', value: '0', description: 'Enable more assertions for debugging.')
-option('enable-iso-codes', type: 'boolean', value: true, description: 'check for iso-codes at build-time')
-option('enable-ld-gc', type: 'boolean', value: true, description: 'Enable garbage collection of unused 
symbols on linking')
-option('enable-gtk-doc', type: 'boolean', value: true, description: 'use gtk-doc to build documentation')
-option('enable-introspection', type: 'boolean', value: true, description: 'Enable introspection for this 
build')
+option('libnm_gtk', type: 'boolean', value: true, description: 'build legacy library libnm-gtk which depends 
on libnm-glib/libnm-util/dbus-glib')
+option('appindicator', type: 'boolean', value: false, description: 'Build with libappindicator support 
instead of xembed systray support.')
+option('wwan', type: 'boolean', value: true, description: 'Enable WWAN support.')
+option('selinux', type: 'boolean', value: true, description: 'Enable support for adjusting SELinux labels in 
configuration editor.')
+option('team', type: 'boolean', value: true, description: 'Enable team configuration editor.')
+option('gcr', type: 'boolean', value: true, description: 'Enable advanced certificate chooser.')
+option('more_asserts', type: 'string', value: '0', description: 'Enable more assertions for debugging.')
+option('iso_codes', type: 'boolean', value: true, description: 'check for iso-codes at build-time')
+option('ld_gc', type: 'boolean', value: true, description: 'Enable garbage collection of unused symbols on 
linking')
+option('gtk_doc', type: 'boolean', value: true, description: 'use gtk-doc to build documentation')
+option('introspection', type: 'boolean', value: true, description: 'Enable introspection for this build')


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