gallium/opencl: set OCL_ICD_FILENAMES with devenv
authorDylan Baker <dylan.c.baker@intel.com>
Fri, 18 Mar 2022 21:05:05 +0000 (14:05 -0700)
committerMarge Bot <emma+marge@anholt.net>
Mon, 21 Mar 2022 16:58:14 +0000 (16:58 +0000)
So that `meson devenv` also sets up OpenCL.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15471>

src/gallium/targets/opencl/meson.build

index ec65fcb..14df6b8 100644 (file)
@@ -114,4 +114,12 @@ if with_opencl_icd
     install : true,
     install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
   )
+
+  if meson.version().version_compare('>= 0.58')
+    # .so is hardcoded in the icd as well
+    devenv.prepend(
+      'OCL_ICD_FILENAMES',
+      meson.current_build_dir() / 'libMesaOpenCL.so.@0@'.format(opencl_version)
+    )
+  endif
 endif