]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: use array type option
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 2 May 2018 04:56:28 +0000 (13:56 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 10 May 2018 06:31:00 +0000 (15:31 +0900)
Array type option is supported since 0.44.0.

meson.build
meson_options.txt

index 9c6bdf91b1f73e1918414c332f8d2e0f2ae301be..aa07ed8e9bfb62428030e0dad389a693040eb7a8 100644 (file)
@@ -760,20 +760,17 @@ conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
 substs.set('SUSHELL', get_option('debug-shell'))
 substs.set('DEBUGTTY', get_option('debug-tty'))
 
-debug = get_option('debug')
 enable_debug_hashmap = false
 enable_debug_mmap_cache = false
-if debug != ''
-        foreach name : debug.split(',')
-                if name == 'hashmap'
-                        enable_debug_hashmap = true
-                elif name == 'mmap-cache'
-                        enable_debug_mmap_cache = true
-                else
-                        message('unknown debug option "@0@", ignoring'.format(name))
-                endif
-        endforeach
-endif
+foreach name : get_option('debug')
+        if name == 'hashmap'
+                enable_debug_hashmap = true
+        elif name == 'mmap-cache'
+                enable_debug_mmap_cache = true
+        else
+                message('unknown debug option "@0@", ignoring'.format(name))
+        endif
+endforeach
 conf.set10('ENABLE_DEBUG_HASHMAP', enable_debug_hashmap)
 conf.set10('ENABLE_DEBUG_MMAP_CACHE', enable_debug_mmap_cache)
 
index 61d3381d17c1bb5971b899537c8b78e6b51db75e..3b718311a3aa7c9f2692ed155a9ca9dba127694a 100644 (file)
@@ -46,8 +46,8 @@ option('debug-shell', type : 'string', value : '/bin/sh',
        description : 'path to debug shell binary')
 option('debug-tty', type : 'string', value : '/dev/tty9',
        description : 'specify the tty device for debug shell')
-option('debug', type : 'string',
-       description : 'enable extra debugging (hashmap,mmap-cache)')
+option('debug', type : 'array', choices : ['hashmap', 'mmap-cache'], value : [],
+       description : 'enable extra debugging')
 option('memory-accounting-default', type : 'boolean',
        description : 'enable MemoryAccounting= by default')