From c40e1bb1d04ed63256ece125b98aa00eec3c09de Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 20 Dec 2022 15:21:11 -0800 Subject: [PATCH] meson: use a feature option for gbm Reviewed-by: Jesse Natalie Acked-by: Alyssa Rosenzweig Part-of: --- meson.build | 20 ++++---------------- meson_options.txt | 4 +--- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/meson.build b/meson.build index 2fc6140b7932b..83df5ba1f484e 100644 --- a/meson.build +++ b/meson.build @@ -359,22 +359,10 @@ if not (with_dri or with_gallium or with_glx != 'disabled') with_shared_glapi = false endif -_gbm = get_option('gbm') -if _gbm == 'true' - _gbm = 'enabled' - warning('gbm option "true" deprecated, please use "enabled" instead.') -elif _gbm == 'false' - _gbm = 'disabled' - warning('gbm option "false" deprecated, please use "disabled" instead.') -endif -if _gbm == 'auto' - with_gbm = system_has_kms_drm and with_dri -else - with_gbm = _gbm == 'enabled' -endif -if with_gbm and not system_has_kms_drm - error('GBM only supports DRM/KMS platforms') -endif +with_gbm = get_option('gbm') \ + .require(system_has_kms_drm, error_message : 'GBM only supports DRM/KMS platforms') \ + .disable_auto_if(not with_dri) \ + .allowed() _xlib_lease = get_option('xlib-lease') if _xlib_lease == 'true' diff --git a/meson_options.txt b/meson_options.txt index e0d7a65610226..6dca669431ad8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -262,9 +262,7 @@ option( ) option( 'gbm', - type : 'combo', - value : 'auto', - choices : ['auto', 'true', 'false', 'enabled', 'disabled'], + type : 'feature', description : 'Build support for gbm platform' ) option(