From 07daee4e8a4c379b3f474dea4699e9779d3dc7b4 Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Sun, 27 Sep 2020 17:12:55 +0800 Subject: [PATCH] meson: Fix support for OpenCL ICD implementation The OpenCL ICD implementation should work with OpenCL ICD loader. So we shouldn't try to install non-ICD OpenCL implementation in this case. Change-Id: Idfb4e6058952215075e2cc253c0d5bb43cac6761 Signed-off-by: Jeffy Chen --- include/mali.icd | 1 - meson.build | 24 +++++++++++++++++++----- meson_options.txt | 2 ++ 3 files changed, 21 insertions(+), 6 deletions(-) delete mode 100644 include/mali.icd diff --git a/include/mali.icd b/include/mali.icd deleted file mode 100644 index 8dabc77..0000000 --- a/include/mali.icd +++ /dev/null @@ -1 +0,0 @@ -libMaliOpenCL.so diff --git a/meson.build b/meson.build index 7864972..9e9c69d 100644 --- a/meson.build +++ b/meson.build @@ -37,7 +37,12 @@ egl_wrappers = {'EGL' : '1'} glesv1_wrappers = {'GLESv1_CM' : '1'} glesv2_wrappers = {'GLESv2' : '2'} wayland_wrappers = {'wayland-egl' : '1'} -cl_wrappers = {'OpenCL' : '1', 'MaliOpenCL' : '1'} + +if get_option('opencl-icd') + cl_wrappers = {'MaliOpenCL' : '1'} +else + cl_wrappers = {'OpenCL' : '1'} +endif # Subdir : headers mali_headers = { @@ -186,6 +191,19 @@ foreach name, values : map endif endforeach + if name == 'OpenCL' and get_option('opencl-icd') + custom_target( + 'vendor icd', + output: 'mali.icd', + command : ['echo', 'libMaliOpenCL.so.1'], + capture : true, + install_dir : get_option('sysconfdir') / 'OpenCL' / 'vendors', + install: true) + + # ICD package doesn't provide headers and pkgconfig + continue + endif + foreach dir, files : headers install_headers(files, subdir : dir) endforeach @@ -197,10 +215,6 @@ foreach name, values : map name : name, description : 'Mali GPU User-Space Binary Drivers' ) - - if name == 'OpenCL' - install_data('include/mali.icd', install_dir : get_option('sysconfdir') / 'OpenCL' / 'vendors') - endif endforeach # Install optional overlay diff --git a/meson_options.txt b/meson_options.txt index cc99f3d..4efeb83 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -10,3 +10,5 @@ option('platform', type: 'combo', choices: ['x11', 'gbm', 'wayland', 'only-cl'], value: 'x11', description: 'platform (default: x11)') option('with-overlay', type: 'boolean', value: 'false', description: 'install overlay (default: false)') +option('opencl-icd', type: 'boolean', value: 'true', + description: 'OpenCL Installable Client Driver (ICD) (default: true)')