From: Yu Watanabe Date: Wed, 2 May 2018 04:56:28 +0000 (+0900) Subject: meson: use array type option X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=031ec29c2d9cfab381bad7a8bad6308da2130649;p=elogind.git meson: use array type option Array type option is supported since 0.44.0. --- diff --git a/meson.build b/meson.build index 51e19835c..6533e38c7 100644 --- a/meson.build +++ b/meson.build @@ -881,27 +881,24 @@ conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) # substs.set('DEBUGTTY', get_option('debug-tty')) #endif // 0 -debug = get_option('debug') enable_debug_hashmap = false enable_debug_mmap_cache = false #if 1 /// additional elogind debug mode enable_debug_elogind = false #endif // 1 -if debug != '' - foreach name : debug.split(',') - if name == 'hashmap' - enable_debug_hashmap = true - elif name == 'mmap-cache' - enable_debug_mmap_cache = true #if 1 /// additional elogind debug mode elif name == 'elogind' enable_debug_elogind = true #endif // 1 - 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) #if 1 /// additional elogind debug mode @@ -1911,6 +1908,7 @@ exe = executable('elogind-inhibit', install_dir : rootbindir) public_programs += [exe] executable('elogind-user-runtime-dir', +executable('elogind-user-runtime-dir', executable('elogind-user-runtime-dir', user_runtime_dir_sources, include_directories : includes, diff --git a/meson_options.txt b/meson_options.txt index fa8e95d0d..fe8a5c972 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -70,8 +70,8 @@ option('kexec-path', type : 'string', description : 'path to kexec') # 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') #else