meson: use a feature option for gbm

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>
This commit is contained in:
Dylan Baker 2022-12-20 15:21:11 -08:00 committed by Marge Bot
parent 6b334a8416
commit c40e1bb1d0
2 changed files with 5 additions and 19 deletions

View File

@ -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'

View File

@ -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(