meson: use a feature option for zstd
authorDylan Baker <dylan.c.baker@intel.com>
Wed, 21 Dec 2022 00:37:35 +0000 (16:37 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 19 Jan 2023 16:29:03 +0000 (16:29 +0000)
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>

meson.build
meson_options.txt

index 559bef4..e9cd42a 100644 (file)
@@ -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()
index 6bbafd3..5c661a2 100644 (file)
@@ -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(