From: Tomas Krizek Date: Mon, 25 Feb 2019 13:34:04 +0000 (+0100) Subject: meson: compat - use string instead of feature X-Git-Tag: v4.0.0~24^2~61 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=34e8b79a0da833a83afe2fb3ce64a3d7ed4fca97;p=thirdparty%2Fknot-resolver.git meson: compat - use string instead of feature --- diff --git a/client/meson.build b/client/meson.build index cb297d420..334f1b6d1 100644 --- a/client/meson.build +++ b/client/meson.build @@ -6,13 +6,14 @@ kresc_src = files([ c_src_lint += kresc_src build_client = false -if not get_option('client').disabled() +if get_option('client') != 'disabled' message('--- client dependencies ---') libedit = dependency('libedit', required: false) if libedit.found() build_client = true else # darwin workaround: missing pkgconfig - libedit = meson.get_compiler('c').find_library('edit', required: get_option('client')) + libedit = meson.get_compiler('c').find_library( + 'edit', required: get_option('client') == 'enabled') if libedit.found() build_client = true endif diff --git a/doc/meson.build b/doc/meson.build index 4e72499c3..2f49a0f22 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -3,7 +3,7 @@ # man page man_config = configuration_data() man_config.set('version', meson.project_version()) -man_config.set('date', run_command('../scripts/get-date.sh', check: true).stdout()) +man_config.set('date', run_command('../scripts/get-date.sh').stdout()) man_config.set('keyfile_default', keyfile_default) man_config.set('man_seealso_systemd', libsystemd.found() ? '\\fIkresd.systemd(7)\\fR, ' : '') @@ -17,7 +17,7 @@ install_man(man_kresd) # html documentation -if get_option('doc').enabled() +if get_option('doc') == 'enabled' message('--- doc dependencies ---') doxygen = find_program('doxygen') sphinx_build = find_program('sphinx-build-3', required: false) diff --git a/etc/config/meson.build b/etc/config/meson.build index c6f5023b8..be18cb8a3 100644 --- a/etc/config/meson.build +++ b/etc/config/meson.build @@ -37,8 +37,8 @@ endforeach # kresd.conf -install_kresd_conf = get_option('install_kresd_conf').enabled() -if get_option('install_kresd_conf').auto() +install_kresd_conf = get_option('install_kresd_conf') == 'enabled' +if get_option('install_kresd_conf') == 'auto' if run_command(['test', '-r', join_paths(etc_dir, 'kresd.conf')]).returncode() == 1 install_kresd_conf = true endif diff --git a/meson.build b/meson.build index bca7ccdc5..1b635c971 100644 --- a/meson.build +++ b/meson.build @@ -4,7 +4,7 @@ project( license: 'GPLv3+', version: '3.2.1', default_options: ['c_std=gnu11', 'b_ndebug=if-release'], - meson_version: '>=0.47.0', + meson_version: '>=0.46', ) @@ -46,11 +46,11 @@ systemd_unit_dir = '' systemd_tmpfiles_dir = '' ## Trust anchors -managed_ta = get_option('managed_ta').enabled() +managed_ta = get_option('managed_ta') == 'enabled' keyfile_default = join_paths(etc_dir, get_option('keyfile_default')) if keyfile_default == join_paths(etc_dir, 'root.keys') install_root_keys = true - managed_ta = managed_ta or get_option('managed_ta').auto() + managed_ta = managed_ta or get_option('managed_ta') == 'auto' else install_root_keys = false if managed_ta @@ -68,8 +68,7 @@ else endif ## Additional options -opt_verbose_log = get_option('verbose_log') -verbose_log = opt_verbose_log.enabled() or opt_verbose_log.auto() +verbose_log = get_option('verbose_log') == 'enabled' or get_option('verbose_log') == 'auto' user = get_option('user') group = get_option('group') @@ -146,7 +145,7 @@ subdir('lib') subdir('client') subdir('daemon') subdir('modules') -if get_option('bench').enabled() +if get_option('bench') == 'enabled' subdir('bench') endif diff --git a/meson_options.txt b/meson_options.txt index bd15eef51..06cc823b4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,7 +8,12 @@ option( option( 'managed_ta', - type: 'feature', + type: 'combo', + choices: [ + 'auto', + 'enabled', + 'disabled', + ], value: 'auto', description: 'auto-manage DNSSEC trust anchors (RFC 5011)', ) @@ -22,15 +27,25 @@ option( option( 'install_kresd_conf', - type: 'feature', + type: 'combo', + choices: [ + 'auto', + 'enabled', + 'disabled', + ], value: 'auto', description: 'creates kresd.conf in config directory', ) option( 'verbose_log', - type: 'feature', - value: 'enabled', + type: 'combo', + choices: [ + 'auto', + 'enabled', + 'disabled', + ], + value: 'auto', description: 'support verbose logging', ) @@ -65,35 +80,60 @@ option( # Component options option( 'bench', - type: 'feature', + type: 'combo', + choices: [ + 'auto', + 'enabled', + 'disabled', + ], value: 'disabled', description: 'build benchmarks', ) option( 'client', - type: 'feature', + type: 'combo', + choices: [ + 'auto', + 'enabled', + 'disabled', + ], value: 'auto', description: 'build kresc client binary', ) option( 'doc', - type: 'feature', + type: 'combo', + choices: [ + 'auto', + 'enabled', + 'disabled', + ], value: 'disabled', description: 'html documentation dependencies and installation', ) option( 'postinstall_tests', - type: 'feature', + type: 'combo', + choices: [ + 'auto', + 'enabled', + 'disabled', + ], value: 'disabled', description: 'postinstall tests with extra dependencies', ) option( 'unit_tests', - type: 'feature', + type: 'combo', + choices: [ + 'auto', + 'enabled', + 'disabled', + ], value: 'auto', description: 'cmocka unit tests', ) diff --git a/tests/meson.build b/tests/meson.build index e57735b60..eabf6f5c1 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -2,9 +2,9 @@ ## unit tests build_unit_tests = false -if not get_option('unit_tests').disabled() +if get_option('unit_tests') != 'disabled' message('--- unit_tests dependencies ---') - cmocka = dependency('cmocka', required: get_option('unit_tests')) + cmocka = dependency('cmocka', required: get_option('unit_tests') == 'enabled') if cmocka.found() build_unit_tests = true subdir('unit') @@ -14,8 +14,12 @@ endif ## postinstall tests -build_postinstall_tests = get_option('postinstall_tests').enabled() +build_postinstall_tests = get_option('postinstall_tests') == 'enabled' if build_postinstall_tests + if meson.version().version_compare('<0.46') + error('meson 0.46+ is required for postinstall_tests') + endif + subdir('config') message('--- postinstall_tests dependencies ---')