OSDN Git Service

update NEWS for libva 2.4.0
[android-x86/hardware-intel-common-libva.git] / va / meson.build
1 version_cfg = configuration_data()
2 version_cfg.set('VA_API_MAJOR_VERSION', va_api_major_version)
3 version_cfg.set('VA_API_MINOR_VERSION', va_api_minor_version)
4 version_cfg.set('VA_API_MICRO_VERSION', va_api_micro_version)
5 version_cfg.set('VA_API_VERSION', va_api_version)
6
7 version_file = configure_file(
8   input : 'va_version.h.in',
9   output : 'va_version.h',
10   configuration : version_cfg)
11
12 libva_sources = [
13   'va.c',
14   'va_compat.c',
15   'va_fool.c',
16   'va_str.c',
17   'va_trace.c',
18 ]
19
20 libva_headers = [
21   'va.h',
22   'va_backend.h',
23   'va_backend_vpp.h',
24   'va_compat.h',
25   'va_dec_hevc.h',
26   'va_dec_jpeg.h',
27   'va_dec_vp8.h',
28   'va_dec_vp9.h',
29   'va_drmcommon.h',
30   'va_egl.h',
31   'va_enc_hevc.h',
32   'va_enc_h264.h',
33   'va_enc_jpeg.h',
34   'va_enc_vp8.h',
35   'va_fei.h',
36   'va_fei_h264.h',
37   'va_fei_hevc.h',
38   'va_enc_mpeg2.h',
39   'va_enc_vp9.h',
40   'va_str.h',
41   'va_tpi.h',
42   'va_vpp.h',
43   version_file,
44 ]
45
46 libva_headers_priv = [
47   'sysdeps.h',
48   'va_fool.h',
49   'va_internal.h',
50   'va_trace.h',
51 ]
52
53 libva_sym = 'libva.syms'
54 libva_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libva_sym)
55
56 install_headers(libva_headers, subdir : 'va')
57
58 libva = shared_library(
59   'va',
60   sources : libva_sources +
61             libva_headers +
62             libva_headers_priv,
63   soversion : libva_lt_current,
64   version : libva_lt_version,
65   c_args : '-DVA_DRIVERS_PATH="' + driverdir + '"',
66   include_directories : configinc,
67   link_args : '-Wl,-version-script,' + libva_sym_path,
68   link_depends : libva_sym,
69   install : true,
70   dependencies : [ dl_dep ])
71
72 libva_dep = declare_dependency(
73   link_with : libva,
74   include_directories : configinc,
75   dependencies : [ dl_dep ])
76
77 if WITH_DRM
78   libva_drm_sources = [
79     'drm/va_drm.c',
80     'drm/va_drm_auth.c',
81     'drm/va_drm_utils.c',
82   ]
83
84   libva_drm_headers = [
85     'drm/va_drm.h',
86   ]
87
88   libva_drm_headers_priv = [
89     'drm/va_drm_auth.h',
90     'drm/va_drm_auth_x11.h',
91     'drm/va_drm_utils.h',
92   ]
93
94   deps = [ libdrm_dep ]
95
96   libva_drm_args = []
97   if get_option('with_x11') != 'no' and x11_dep.found()
98     libva_drm_sources += [ 'drm/va_drm_auth_x11.c' ]
99     libva_drm_args += [
100       '-DLIBVA_MAJOR_VERSION=@0@'.format(libva_major_version)
101     ]
102     deps += [ x11_dep ]
103   endif
104
105   install_headers(libva_drm_headers, subdir : 'va')
106
107   libva_drm = shared_library(
108     'va-drm',
109     sources : libva_drm_sources +
110               libva_drm_headers +
111               libva_drm_headers_priv,
112     soversion : libva_lt_current,
113     version : libva_lt_version,
114     install : true,
115     c_args : libva_drm_args,
116     dependencies : deps + [ libva_dep ])
117
118   libva_drm_dep = declare_dependency(
119     link_with : libva_drm,
120     include_directories : configinc,
121     dependencies : deps)
122 endif
123
124 if WITH_X11
125   libva_x11_sources = [
126     'x11/dri2_util.c',
127     'x11/va_dri2.c',
128     'x11/va_dricommon.c',
129     'x11/va_fglrx.c',
130     'x11/va_nvctrl.c',
131     'x11/va_x11.c',
132   ]
133
134   libva_x11_headers = [
135     'va_x11.h',
136     'x11/va_dri2.h',
137     'x11/va_dricommon.h',
138   ]
139
140   libva_x11_headers_priv = [
141     'x11/va_dri2str.h',
142     'x11/va_dri2tokens.h',
143     'x11/va_fglrx.h',
144     'x11/va_nvctrl.h',
145   ]
146
147   install_headers(libva_x11_headers, subdir : 'va')
148
149   deps = [ libdrm_dep, x11_dep, xext_dep, xfixes_dep, libva_dep ]
150
151   libva_x11 = shared_library(
152     'va-x11',
153     sources : libva_x11_sources +
154               libva_x11_headers +
155               libva_x11_headers_priv,
156     soversion : libva_lt_current,
157     version : libva_lt_version,
158     install : true,
159     dependencies : deps)
160
161   libva_x11_dep = declare_dependency(
162     link_with : libva_x11,
163     include_directories : configinc,
164     dependencies : deps)
165 endif
166
167 if WITH_GLX
168   libva_glx_sources = [
169     'glx/va_glx.c',
170     'glx/va_glx_impl.c',
171   ]
172
173   libva_glx_headers = [
174     'glx/va_backend_glx.h',
175     'glx/va_glx.h',
176   ]
177
178   libva_glx_headers_priv = [
179     'glx/va_glx_impl.h',
180     'glx/va_glx_private.h',
181   ]
182
183   install_headers(libva_glx_headers, subdir : 'va')
184
185   deps = [ gl_dep, libva_x11_dep ]
186
187   libva_glx = shared_library(
188     'va-glx',
189     sources : libva_glx_sources +
190               libva_glx_headers +
191               libva_glx_headers_priv,
192     soversion : libva_lt_current,
193     version : libva_lt_version,
194     install : true,
195     dependencies : deps)
196
197   libva_glx_dep = declare_dependency(
198     link_with : libva_glx,
199     include_directories : configinc,
200     dependencies : deps)
201 endif
202
203 if WITH_WAYLAND
204   libva_wayland_sources = [
205     'wayland/va_wayland.c',
206     'wayland/va_wayland_drm.c',
207     'wayland/va_wayland_emgd.c',
208     'drm/va_drm_utils.c',
209   ]
210
211   libva_wayland_headers = [
212     'wayland/va_backend_wayland.h',
213     'wayland/va_wayland.h',
214   ]
215
216   libva_wayland_headers_priv = [
217     'wayland/va_wayland_drm.h',
218     'wayland/va_wayland_emgd.h',
219     'wayland/va_wayland_private.h',
220   ]
221
222   protocol_files = [
223     custom_target(
224       'wayland-drm-client-protocol.c',
225       output : 'wayland-drm-client-protocol.c',
226       input : 'wayland/wayland-drm.xml',
227       command : [wl_scanner, 'code', '@INPUT@', '@OUTPUT@']),
228
229     custom_target(
230       'wayland-drm-client-protocol.h',
231       output : 'wayland-drm-client-protocol.h',
232       input : 'wayland/wayland-drm.xml',
233       command : [wl_scanner, 'client-header', '@INPUT@', '@OUTPUT@'])
234   ]
235
236   install_headers(libva_wayland_headers, subdir : 'va')
237
238   deps = [ libdrm_dep, wayland_dep, libva_dep ]
239
240   libva_wayland = shared_library(
241     'va-wayland',
242     sources : libva_wayland_sources +
243               libva_wayland_headers +
244               libva_wayland_headers_priv +
245               protocol_files,
246     soversion : libva_lt_current,
247     version : libva_lt_version,
248     install : true,
249     dependencies : deps)
250
251   libva_wayland_dep = declare_dependency(
252     link_with : libva_wayland,
253     include_directories : configinc,
254     dependencies : deps)
255 endif