[gtk/issue-2: 3/7] build: Rename 'with-included-immodules' option



commit 5996b5ad6b8170d5b78352f2a3519f5c4ababc3b
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Feb 14 13:43:19 2018 +0000

    build: Rename 'with-included-immodules' option
    
    We can call it 'included-immodules', and simplify its logic by always
    attempting to split the value, to avoid turning an array into a string
    and then back into an array again.

 meson_options.txt         |  4 ++--
 modules/input/meson.build | 20 ++++++--------------
 2 files changed, 8 insertions(+), 16 deletions(-)
---
diff --git a/meson_options.txt b/meson_options.txt
index 42283abdd2..2f9dd80285 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -26,8 +26,8 @@ option('enable-xinerama', type: 'combo', choices : ['yes', 'no', 'auto'], value
   description : 'Enable support for the Xinerama extension')
 option('dynamic-modules', type: 'boolean', value : true,
   description : 'Allow dynamic module loading')
-option('with-included-immodules', type: 'string', value : '',
-  description : 'Build the specified input methods into gtk (comma-separated list or "all" or "none")')
+option('included-immodules', type: 'string', value : 'none',
+  description : 'Build the specified input methods (comma-separated list, "all", or "none")')
 option('documentation', type: 'boolean', value: 'false',
   description : 'Build API reference and tools documentation')
 option('man-pages', type: 'boolean', value: 'false',
diff --git a/modules/input/meson.build b/modules/input/meson.build
index 72171582db..e60dbcc59e 100644
--- a/modules/input/meson.build
+++ b/modules/input/meson.build
@@ -32,21 +32,15 @@ all_immodules = [
 all_immodules += backend_immodules
 
 # Allow building some or all immodules included
-included_immodules = get_option('with-included-immodules')
-if included_immodules == 'none'
-  included_immodules = ''
-elif included_immodules == 'all' or included_immodules == 'yes'
-  included_immodules = ','.join(all_immodules)
-endif
-
-if included_immodules == ''
-  have_included_immodules = false
+included_immodules = get_option('included-immodules').split(',')
+if included_immodules.contains('none')
   included_immodules = []
-else
-  have_included_immodules = true
-  included_immodules = included_immodules.split(',')
+elif included_immodules.contains('all')
+  included_immodules = all_immodules
 endif
 
+have_included_immodules = included_immodules.length() > 0
+
 foreach im: included_immodules
   if not all_immodules.contains(im)
     error('The specified input method "@0@" is not available (available methods: @1@)'.format(im, ', 
'.join(all_immodules)))
@@ -107,5 +101,3 @@ foreach m: method_defs
     endif
   endif
 endforeach
-
-# TODO: post-install gtk4-query-immodules run to create immodules.c


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