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 <jeffy.chen@rock-chips.com>
This commit is contained in:
Jeffy Chen
2020-09-27 17:12:55 +08:00
parent 77feb33853
commit 07daee4e8a
3 changed files with 21 additions and 6 deletions

View File

@@ -1 +0,0 @@
libMaliOpenCL.so

View File

@@ -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

View File

@@ -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)')