meson: turn `glvnd` option into a feature

Makes for nicer code, and allows the next commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26367>
This commit is contained in:
Eric Engestrom 2023-11-20 15:08:26 +00:00 committed by Marge Bot
parent 3a4a16e9e8
commit 4f25b84b24
4 changed files with 18 additions and 19 deletions

View File

@ -265,7 +265,7 @@ alpine-build-testing:
-D glx=disabled -D glx=disabled
-D gbm=enabled -D gbm=enabled
-D egl=enabled -D egl=enabled
-D glvnd=false -D glvnd=disabled
-D platforms=wayland -D platforms=wayland
LLVM_VERSION: "16" LLVM_VERSION: "16"
GALLIUM_DRIVERS: "crocus,etnaviv,freedreno,iris,kmsro,lima,nouveau,panfrost,r300,r600,radeonsi,svga,swrast,tegra,v3d,vc4,virgl,zink" GALLIUM_DRIVERS: "crocus,etnaviv,freedreno,iris,kmsro,lima,nouveau,panfrost,r300,r600,radeonsi,svga,swrast,tegra,v3d,vc4,virgl,zink"
@ -305,7 +305,7 @@ fedora-release:
-D glx=dri -D glx=dri
-D gbm=enabled -D gbm=enabled
-D egl=enabled -D egl=enabled
-D glvnd=true -D glvnd=enabled
-D platforms=x11,wayland -D platforms=x11,wayland
EXTRA_OPTION: > EXTRA_OPTION: >
-D b_lto=true -D b_lto=true
@ -540,7 +540,7 @@ debian-clang:
-D glx=dri -D glx=dri
-D gbm=enabled -D gbm=enabled
-D egl=enabled -D egl=enabled
-D glvnd=true -D glvnd=enabled
-D platforms=x11,wayland -D platforms=x11,wayland
GALLIUM_ST: > GALLIUM_ST: >
-D dri3=enabled -D dri3=enabled

View File

@ -122,7 +122,7 @@ Building the Code
:: ::
cd $TOP/mesa cd $TOP/mesa
meson builddir -Dvulkan-drivers= -Dgallium-drivers=svga -Ddri-drivers= -Dglvnd=true -Dglvnd-vendor-name=mesa meson builddir -Dvulkan-drivers= -Dgallium-drivers=svga -Ddri-drivers= -Dglvnd=enabled -Dglvnd-vendor-name=mesa
meson compile -C builddir meson compile -C builddir
sudo meson install -C builddir sudo meson install -C builddir

View File

@ -543,20 +543,18 @@ if with_glx != 'disabled'
endif endif
endif endif
dep_glvnd = null_dep _glvnd = get_option('glvnd') \
with_glvnd = get_option('glvnd') .require(not with_platform_windows,
error_message: 'glvnd cannot be used on Windows') \
.require(with_glx != 'xlib',
error_message: 'Cannot build glvnd support for GLX that is not DRI based.') \
.require(with_glx != 'disabled' or with_egl,
error_message: 'glvnd requires DRI based GLX and/or EGL') \
.require(get_option('egl-lib-suffix') == '',
error_message: '''EGL lib suffix can't be used with libglvnd''')
dep_glvnd = dependency('libglvnd', version : '>= 1.3.2', required : _glvnd)
with_glvnd = dep_glvnd.found()
if with_glvnd if with_glvnd
if with_platform_windows
error('glvnd cannot be used on Windows')
elif with_glx == 'xlib'
error('Cannot build glvnd support for GLX that is not DRI based.')
elif with_glx == 'disabled' and not with_egl
error('glvnd requires DRI based GLX and/or EGL')
endif
if get_option('egl-lib-suffix') != ''
error('''EGL lib suffix can't be used with libglvnd''')
endif
dep_glvnd = dependency('libglvnd', version : '>= 1.3.2')
pre_args += '-DUSE_LIBGLVND=1' pre_args += '-DUSE_LIBGLVND=1'
endif endif
glvnd_vendor_name = get_option('glvnd-vendor-name') glvnd_vendor_name = get_option('glvnd-vendor-name')

View File

@ -361,8 +361,9 @@ option(
option( option(
'glvnd', 'glvnd',
type : 'boolean', type : 'feature',
value : false, value : 'disabled',
deprecated: {'true': 'enabled', 'false': 'disabled'},
description : 'Enable GLVND support.' description : 'Enable GLVND support.'
) )