-
Notifications
You must be signed in to change notification settings - Fork 127
Expand file tree
/
Copy pathmeson.build
More file actions
144 lines (114 loc) · 4.44 KB
/
Copy pathmeson.build
File metadata and controls
144 lines (114 loc) · 4.44 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
project('gstreamer-imx', 'c', default_options : ['c_std=c99'], version : '2.2.0', license: 'LGPL-2.0-or-later', meson_version: '>= 0.53.2')
message('Setting up build configuration for gstreamer-imx version ' + meson.project_version())
cc = meson.get_compiler('c')
pkg = import('pkgconfig')
plugins = []
# test for miscellaneous system libraries
libdl_dep = cc.find_library('dl', required : true)
libm_dep = cc.find_library('m', required : true)
# test for libimxdmabuffer
libimxdmabuffer_dep = dependency('libimxdmabuffer', version : '>=1.1.2', required : true, method : 'pkg-config')
dmabuf_allocator_available = false
dma_heap_support = cc.compiles(
'''
#include <imxdmabuffer/imxdmabuffer_config.h>
#ifndef IMXDMABUFFER_DMA_HEAP_ALLOCATOR_ENABLED
#error dma-heap support is disabled
#endif
''',
dependencies : [libimxdmabuffer_dep],
name : 'dma-heap allocator support'
)
if dma_heap_support
message('libimxdmabuffer supports dma-heap allocation - enabling dma-heap GstAllocator')
dmabuf_allocator_available = true
else
message('libimxdmabuffer does not support dma-heap allocation - not enabling dma-heap GstAllocator')
endif
ion_support = cc.compiles(
'''
#include <imxdmabuffer/imxdmabuffer_config.h>
#ifndef IMXDMABUFFER_ION_ALLOCATOR_ENABLED
#error ION support is disabled
#endif
''',
dependencies : [libimxdmabuffer_dep],
name : 'ION allocator support'
)
if ion_support
message('libimxdmabuffer supports ION allocation - enabling ION GstAllocator')
dmabuf_allocator_available = true
else
message('libimxdmabuffer does not support ION allocation - not enabling ION GstAllocator')
endif
# test for GStreamer libraries
gstreamer_dep = dependency('gstreamer-1.0', version : '>=1.14.0', required : true)
gstreamer_base_dep = dependency('gstreamer-base-1.0', version : '>=1.14.0', required : true)
gstreamer_allocators_dep = dependency('gstreamer-allocators-1.0', version : '>=1.14.0', required : true)
gstreamer_audio_dep = dependency('gstreamer-audio-1.0', version : '>=1.14.0', required : false)
gstreamer_video_dep = dependency('gstreamer-video-1.0', version : '>=1.14.0', required : false)
if gstreamer_audio_dep.found()
message('found gstaudio library - building audio plugins')
else
message('could not find gstaudio library - not building audio plugins')
endif
if gstreamer_video_dep.found()
message('found gstvideo library - building video plugins')
else
message('could not find gstvideo library - not building video plugins')
endif
plugins_install_dir = join_paths(get_option('libdir'), 'gstreamer-1.0')
imx_headers_path = get_option('imx-headers-path')
sys_root = get_option('sysroot')
if sys_root != ''
message('Using sysroot from command line argument: "' + sys_root + '"')
else
if meson.version().version_compare('>= 0.54.0')
sys_root = meson.get_external_property('sys_root', '', native: false)
message('Using sysroot from meson external properties: "' + sys_root + '"')
else
error('sysroot must be specified as a build option when using Meson older than 0.54.0')
endif
endif
configinc = include_directories('.')
libsinc = include_directories('gst-libs')
gst_package_name = get_option('package-name')
if gst_package_name == ''
fs = import('fs')
if fs.is_dir('.git')
gst_package_name = 'GStreamer i.MX Plug-ins git'
else
gst_package_name = 'GStreamer i.MX Plug-ins source release'
endif
endif
conf_data = configuration_data()
conf_data.set_quoted('GST_PACKAGE_NAME', gst_package_name)
conf_data.set_quoted('GST_PACKAGE_ORIGIN', get_option('package-origin'))
conf_data.set_quoted('PACKAGE', 'gstreamer-imx')
conf_data.set_quoted('PACKAGE_BUGREPORT', 'https://github.com/Freescale/gstreamer-imx')
conf_data.set_quoted('VERSION', meson.project_version())
if dma_heap_support
conf_data.set('WITH_GST_DMA_HEAP_ALLOCATOR', 1)
endif
if ion_support
conf_data.set('WITH_GST_ION_ALLOCATOR', 1)
endif
if dmabuf_allocator_available
conf_data.set('GST_DMABUF_ALLOCATOR_AVAILABLE', 1)
endif
subdir('gst-libs/imx2d')
subdir('gst-libs/gst/imx/common')
subdir('gst-libs/gst/imx/video')
subdir('ext/vpu')
subdir('ext/audio')
subdir('ext/imx2d')
subdir('sys/v4l2video')
configure_file(output : 'config.h', configuration : conf_data)
if meson.version().version_compare('>=0.54')
gst_plugins = []
foreach plugin: plugins
dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
meson.override_dependency(plugin.name(), dep)
gst_plugins += [dep]
endforeach
endif