OSDN Git Service

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