meson: add LIBGL_DRIVERS_PATH to the devenv

This allows using built dri OpenGL drivers with the `meson devenv`
command

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14826>
This commit is contained in:
Dylan Baker 2022-02-01 13:23:23 -08:00
parent 2f916f2be6
commit 5e994c5d98

View file

@ -118,6 +118,24 @@ foreach d : [[with_gallium_kmsro, [
endif
endforeach
if meson.version().version_compare('>= 0.58')
# This only works on Unix-like oses, which is probably fine for dri
prog_ln = find_program('ln', required : false)
if prog_ln.found()
devenv.set('LIBGL_DRIVERS_PATH', meson.current_build_dir())
foreach d : gallium_dri_drivers
custom_target(
'devenv_@0@'.format(d),
input : libgallium_dri,
output : d,
command : [prog_ln, '-f', '@INPUT@', '@OUTPUT@'],
build_by_default : true,
)
endforeach
endif
endif
meson.add_install_script(
install_megadrivers_py.path(),
libgallium_dri.full_path(),