From 5e994c5d983986788c18f2b87a3ee80e4c3f5936 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 1 Feb 2022 13:23:23 -0800 Subject: [PATCH] meson: add LIBGL_DRIVERS_PATH to the devenv This allows using built dri OpenGL drivers with the `meson devenv` command Reviewed-by: Adam Jackson Part-of: --- src/gallium/targets/dri/meson.build | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/gallium/targets/dri/meson.build b/src/gallium/targets/dri/meson.build index d066ce60950..4733f439e49 100644 --- a/src/gallium/targets/dri/meson.build +++ b/src/gallium/targets/dri/meson.build @@ -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(),