-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
executable file
·91 lines (75 loc) · 2.4 KB
/
Copy pathmeson.build
File metadata and controls
executable file
·91 lines (75 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
project('imx-opencl-converter', 'c',
version : '0.12',
meson_version : '>= 0.48',
)
pro_version = meson.project_version()
pro_name = meson.project_name()
cc = meson.get_compiler('c')
unneeded_dep = dependency('', required : false)
if unneeded_dep.found()
error ('Found unfindable dependency')
endif
imxopencl_ldflags = []
if cc.has_header('CL/cl.h')
imxopencl_ldflags += ['-lOpenCL']
endif
imxopencl_cflags = []
if cc.has_header('CL/cl_ext_viv.h')
imxopencl_cflags += ['-DOCL_VENDOR_VIV', '-DCL_TARGET_OPENCL_VERSION=300']
else
imxopencl_cflags += ['-DOCL_VENDOR_ARM', '-DCL_TARGET_OPENCL_VERSION=120']
endif
ocl_converter_sources = [
'src/ocl_converter_utils.c',
'src/ocl_converter.c',
'src/ocl.c',
'src/ocl_allocator_dmabuf.c',
'src/ocl_allocator.c',
]
ocl_converter_headers = [
'ghdr/imx_opencl_converter.h',
'src/ocl_converter_utils.h',
'src/ocl_converter_internal.h',
'src/ocl.h',
'src/ocl_allocator_if.h',
'src/ocl_allocator_dmabuf.h'
]
libs_install_dir = get_option('libdir')
version_flags = ['-DVERSION="@0@"'.format(pro_version), '-DPACKAGE="@0@"'.format(pro_name)]
ghdrinc = include_directories('ghdr')
configinc = include_directories('.')
ocl_converter = library('imxoclconvert',
ocl_converter_sources + ocl_converter_headers,
c_args : imxopencl_cflags + version_flags,
link_args : imxopencl_ldflags,
include_directories : [ghdrinc, configinc],
version : pro_version,
soversion : 0,
install : true,
install_dir : libs_install_dir,
dependencies : [],
)
ocl_converter_dep = declare_dependency(link_with : ocl_converter)
src_file = ['src/ocl_converter_test.c',]
executable('ocl_converter_test',
src_file,
c_args : imxopencl_cflags,
include_directories : [ghdrinc],
install: true,
link_args : ['-pthread'],
dependencies : [ocl_converter_dep],
)
install_data(sources: 'src/ocl_converter.cl', install_dir : '/usr/share/')
if cc.has_header('CL/cl_ext_viv.h')
install_data(sources: 'src/ocl_converter_viv.cl', rename : 'ocl_converter_ext.cl', install_dir : '/usr/share/')
else
install_data(sources: 'src/ocl_converter_arm.cl', rename : 'ocl_converter_ext.cl', install_dir : '/usr/share/')
endif
pkgconf = import('pkgconfig')
install_data(sources: 'ghdr/imx_opencl_converter.h', install_dir : get_option('includedir'))
pkgconf.generate(
name: 'imx-opencl-converter',
description: 'NXP i.MX Opencl converter',
version: '1.0.0',
extra_cflags: ['-I${includedir}']
)