From afa97e746855436e2c9a41784b11d948f9aa3dc3 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 20 Dec 2022 16:37:35 -0800 Subject: [PATCH] meson: use a feature option for zstd Reviewed-by: Jesse Natalie Acked-by: Alyssa Rosenzweig Part-of: --- meson.build | 18 +++--------------- meson_options.txt | 4 +--- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/meson.build b/meson.build index 559bef44ac44a..e9cd42ab8cd27 100644 --- a/meson.build +++ b/meson.build @@ -1458,21 +1458,9 @@ if dep_zlib.found() pre_args += '-DHAVE_ZLIB' endif -_zstd = get_option('zstd') -if _zstd == 'true' - _zstd = 'enabled' - warning('zstd option "true" deprecated, please use "enabled" instead.') -elif _zstd == 'false' - _zstd = 'disabled' - warning('zstd option "false" deprecated, please use "disabled" instead.') -endif -if _zstd != 'disabled' - dep_zstd = dependency('libzstd', required : _zstd == 'enabled') - if dep_zstd.found() - pre_args += '-DHAVE_ZSTD' - endif -else - dep_zstd = null_dep +dep_zstd = dependency('libzstd', required : get_option('zstd')) +if dep_zstd.found() + pre_args += '-DHAVE_ZSTD' endif with_compression = dep_zlib.found() or dep_zstd.found() diff --git a/meson_options.txt b/meson_options.txt index 6bbafd3c5195f..5c661a2003783 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -442,9 +442,7 @@ option( ) option( 'zstd', - type : 'combo', - choices : ['auto', 'true', 'false', 'enabled', 'disabled'], - value : 'auto', + type : 'feature', description : 'Use ZSTD instead of ZLIB in some cases.' ) option(