meson: Build gallium auxiliary
[mesa.git] / meson.build
1 # Copyright © 2017 Intel Corporation
2
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
9
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
12
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 # SOFTWARE.
20
21 project('mesa', ['c', 'cpp'], version : '17.3.0-devel', license : 'MIT',
22 default_options : ['c_std=c99', 'cpp_std=c++11'])
23
24 # Arguments for the preprocessor, put these in a separate array from the C and
25 # C++ (cpp in meson terminology) arguments since they need to be added to the
26 # default arguments for both C and C++.
27 pre_args = [
28 '-D__STDC_CONSTANT_MACROS',
29 '-D__STDC_FORMAT_MACROS',
30 '-D__STDC_LIMIT_MACROS',
31 '-DVERSION="@0@"'.format(meson.project_version()),
32 '-DPACKAGE_VERSION=VERSION',
33 '-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"',
34 '-D_GNU_SOURCE',
35 ]
36
37 with_vulkan_icd_dir = get_option('vulkan-icd-dir')
38 with_tests = get_option('build-tests')
39 with_valgrind = get_option('valgrind')
40 with_asm = get_option('asm')
41 with_llvm = get_option('llvm')
42 if get_option('texture-float')
43 pre_args += '-DTEXTURE_FLOAT_ENABLED'
44 message('WARNING: Floating-point texture enabled. Please consult docs/patents.txt and your lawyer before building mesa.')
45 endif
46
47 # XXX: yeah, do these
48 with_appledri = false
49 with_windowsdri = false
50
51 dri_drivers_path = get_option('dri-drivers-path')
52 if dri_drivers_path == ''
53 dri_drivers_path = join_paths(get_option('libdir'), 'dri')
54 endif
55
56 with_gles1 = get_option('gles1')
57 with_gles2 = get_option('gles2')
58 with_opengl = get_option('opengl')
59 with_any_opengl = with_opengl or with_gles1 or with_gles2
60 # Only build shared_glapi if at least one OpenGL API is enabled
61 with_shared_glapi = get_option('shared-glapi') and with_any_opengl
62
63 # TODO: these will need options, but at the moment they just control header
64 # installs
65 with_osmesa = false
66
67 # shared-glapi is required if at least two OpenGL APIs are being built
68 if not with_shared_glapi
69 if ((with_gles1 and with_gles2) or (with_gles1 and with_opengl)
70 or (with_gles2 and with_opengl))
71 error('shared-glapi required for building two or more of OpenGL, OpenGL ES 1.x, OpenGL ES 2.x')
72 endif
73 endif
74
75 # We require OpenGL for OpenGL ES
76 if (with_gles1 or with_gles2) and not with_opengl
77 error('building OpenGL ES without OpenGL is not supported.')
78 endif
79
80 with_dri = false
81 with_dri_i915 = false
82 with_dri_i965 = false
83 with_dri_swrast = false
84 _drivers = get_option('dri-drivers')
85 if _drivers != ''
86 _split = _drivers.split(',')
87 with_dri_i915 = _split.contains('i915')
88 with_dri_i965 = _split.contains('i965')
89 with_dri_swrast = _split.contains('swrast')
90 with_dri = true
91 endif
92
93 with_gallium = false
94 with_gallium_radeonsi = false
95 _drivers = get_option('gallium-drivers')
96 if _drivers != ''
97 _split = _drivers.split(',')
98 with_gallium_radeonsi = _split.contains('radeonsi')
99 with_gallium = true
100 with_dri = true
101 endif
102
103 if not (with_dri or with_gallium)
104 with_gles1 = false
105 with_gles2 = false
106 with_opengl = false
107 with_any_opengl = false
108 with_shared_glapi = false
109 endif
110
111 dep_libdrm_intel = []
112 if with_dri_i915
113 dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
114 endif
115
116 # TODO: other OSes
117 with_dri_platform = 'drm'
118
119 # TODO: conditionalize libdrm requirement
120 dep_libdrm = dependency('libdrm', version : '>= 2.4.75')
121 pre_args += '-DHAVE_LIBDRM'
122
123 with_dri2 = with_dri_platform == 'drm' and dep_libdrm.found()
124 with_dri3 = get_option('dri3')
125 if with_dri3 == 'auto'
126 if host_machine.system() == 'linux' and with_dri2
127 with_dri3 = true
128 else
129 with_dri3 = false
130 endif
131 elif with_dri3 == 'yes'
132 if not with_dri2
133 error('dri3 support requires libdrm')
134 endif
135 with_dri3 = true
136 else
137 with_dri3 = false
138 endif
139
140 # TODO: there are more platforms required for non-vulkan drivers
141 with_platform_wayland = false
142 with_platform_x11 = false
143 with_platform_drm = false
144 _platforms = get_option('platforms')
145 if _platforms != ''
146 _split = _platforms.split(',')
147 with_platform_x11 = _split.contains('x11')
148 with_platform_wayland = _split.contains('wayland')
149 with_platform_drm = _split.contains('drm')
150 endif
151
152 with_gbm = get_option('gbm')
153 if with_gbm == 'auto' and with_dri # TODO: or gallium
154 with_gbm = host_machine.system() == 'linux'
155 elif with_gbm == 'yes'
156 if not ['linux', 'bsd'].contains(host_machine.system())
157 error('GBM only supports unix-like platforms')
158 endif
159 with_gbm = true
160 else
161 with_gbm = false
162 endif
163
164 pre_args += '-DGLX_USE_TLS'
165 with_glx = get_option('glx')
166 if with_glx != 'disabled'
167 if not (with_platform_x11 and with_any_opengl) and with_glx != 'auto'
168 error('Cannot build GLX support without X11 platform support and at least one OpenGL API')
169 elif with_glx == 'gallium-xlib'
170 if not with_gallium
171 error('Gallium-xlib based GLX requires at least one gallium driver')
172 elif with_dri
173 error('gallium-xlib conflicts with any dri driver')
174 endif
175 elif with_glx == 'dri' and not with_dri
176 error('dri based GLX requires at least one DRI driver')
177 elif with_glx == 'auto'
178 if with_dri
179 with_glx = 'dri'
180 elif with_gallium
181 with_glx = 'gallium-xlib'
182 elif with_platform_x11 and with_any_opengl
183 with_glx = 'xlib'
184 else
185 with_glx = 'disabled'
186 endif
187 endif
188 endif
189
190 with_glvnd = get_option('glvnd')
191 if with_glvnd and with_glx != 'dri'
192 message('glvnd requires dri based glx')
193 endif
194
195 # TODO: toggle for this
196 with_glx_direct = true
197
198 if with_vulkan_icd_dir == ''
199 with_vulkan_icd_dir = join_paths(get_option('datadir'), 'vulkan/icd.d')
200 endif
201
202 with_intel_vk = false
203 with_amd_vk = false
204 with_any_vk = false
205 _vulkan_drivers = get_option('vulkan-drivers')
206 if _vulkan_drivers != ''
207 _split = _vulkan_drivers.split(',')
208 with_intel_vk = _split.contains('intel')
209 with_amd_vk = _split.contains('amd')
210 with_any_vk = with_amd_vk or with_intel_vk
211 if not (with_platform_x11 or with_platform_wayland)
212 error('Vulkan requires at least one platform (x11, wayland)')
213 endif
214 if with_platform_x11 and not with_dri3
215 error('Vulkan drivers require dri3 for X11 support')
216 endif
217 endif
218
219 if with_dri or with_gallium
220 if with_glx == 'disabled' # TODO: or egl
221 error('building dri or gallium drivers require at least one window system')
222 endif
223 endif
224
225 prog_python2 = find_program('python2')
226 has_mako = run_command(prog_python2, '-c', 'import mako')
227 if has_mako.returncode() != 0
228 error('Python (2.x) mako module required to build mesa.')
229 endif
230
231 cc = meson.get_compiler('c')
232 if cc.get_id() == 'gcc' and cc.version().version_compare('< 4.4.6')
233 error('When using GCC, version 4.4.6 or later is required.')
234 endif
235
236 # Define DEBUG for debug and debugoptimized builds
237 if get_option('buildtype').startswith('debug')
238 pre_args += '-DDEBUG'
239 endif
240
241 if get_option('shader-cache')
242 pre_args += '-DENABLE_SHADER_CACHE'
243 elif with_amd_vk
244 error('Radv requires shader cache support')
245 endif
246
247 # Check for GCC style builtins
248 foreach b : ['bswap32', 'bswap64', 'clz', 'clzll', 'ctz', 'expect', 'ffs',
249 'ffsll', 'popcount', 'popcountll', 'unreachable']
250 if cc.has_function(b)
251 pre_args += '-DHAVE___BUILTIN_@0@'.format(b.to_upper())
252 endif
253 endforeach
254
255 # check for GCC __attribute__
256 foreach a : ['const', 'flatten', 'malloc', 'pure', 'unused',
257 'warn_unused_result', 'weak',]
258 if cc.compiles('int foo(void) __attribute__((@0@));'.format(a),
259 name : '__attribute__((@0@))'.format(a))
260 pre_args += '-DHAVE_FUNC_ATTRIBUTE_@0@'.format(a.to_upper())
261 endif
262 endforeach
263 if cc.compiles('int foo(const char *p, ...) __attribute__((format(printf, 1, 2)));',
264 name : '__attribute__((format(...)))')
265 pre_args += '-DHAVE_FUNC_ATTRIBUTE_FORMAT'
266 endif
267 if cc.compiles('struct __attribute__((packed)) foo { int bar; };',
268 name : '__attribute__((packed))')
269 pre_args += '-DHAVE_FUNC_ATTRIBUTE_PACKED'
270 endif
271 if cc.compiles('int *foo(void) __attribute__((returns_nonnull));',
272 name : '__attribute__((returns_nonnull))')
273 pre_args += '-DHAVE_FUNC_ATTRIBUTE_NONNULL'
274 endif
275 if cc.compiles('''int foo_def(void) __attribute__((visibility("default")));
276 int foo_hid(void) __attribute__((visibility("hidden")));
277 int foo_int(void) __attribute__((visibility("internal")));
278 int foo_pro(void) __attribute__((visibility("protected")));''',
279 name : '__attribute__((visibility(...)))')
280 pre_args += '-DHAVE_FUNC_ATTRIBUTE_VISBILITY'
281 endif
282 if cc.compiles('int foo(void) { return 0; } int bar(void) __attribute__((alias("foo")));',
283 name : '__attribute__((alias(...)))')
284 pre_args += '-DHAVE_FUNC_ATTRIBUTE_ALIAS'
285 endif
286
287 # TODO: this is very incomplete
288 if host_machine.system() == 'linux'
289 pre_args += '-D_GNU_SOURCE'
290 endif
291
292 # Check for generic C arguments
293 c_args = []
294 foreach a : ['-Wall', '-Werror=implicit-function-declaration',
295 '-Werror=missing-prototypes', '-fno-math-errno',
296 '-fno-trapping-math', '-Qunused-arguments']
297 if cc.has_argument(a)
298 c_args += a
299 endif
300 endforeach
301 c_vis_args = []
302 if cc.has_argument('-fvisibility=hidden')
303 c_vis_args += '-fvisibility=hidden'
304 endif
305
306 # Check for generic C++ arguments
307 cpp = meson.get_compiler('cpp')
308 cpp_args = []
309 foreach a : ['-Wall', '-fno-math-errno', '-fno-trapping-math',
310 '-Qunused-arguments', '-Wno-non-virtual-dtor']
311 if cpp.has_argument(a)
312 cpp_args += a
313 endif
314 endforeach
315 cpp_vis_args = []
316 if cpp.has_argument('-fvisibility=hidden')
317 cpp_vis_args += '-fvisibility=hidden'
318 endif
319
320 # Check for C and C++ arguments for MSVC2013 compatibility. These are only used
321 # in parts of the mesa code base that need to compile with old versions of
322 # MSVC, mainly common code
323 c_msvc_compat_args = []
324 cpp_msvc_compat_args = []
325 foreach a : ['-Werror=pointer-arith', '-Werror=vla']
326 if cc.has_argument(a)
327 c_msvc_compat_args += a
328 endif
329 if cpp.has_argument(a)
330 cpp_msvc_compat_args += a
331 endif
332 endforeach
333
334 no_override_init_args = []
335 foreach a : ['-Wno-override-init', '-Wno-initializer-overrides']
336 if cc.has_argument(a)
337 no_override_init_args += a
338 endif
339 endforeach
340
341 # TODO: SSE41 (which is only required for core mesa)
342
343 # Check for GCC style atomics
344 if cc.compiles('int main() { int n; return __atomic_load_n(&n, __ATOMIC_ACQUIRE); }',
345 name : 'GCC atomic builtins')
346 pre_args += '-DUSE_GCC_ATOMIC_BUILTINS'
347 endif
348 if not cc.links('''#include <stdint.h>
349 uint64_t v;
350 int main() {
351 return __sync_add_and_fetch(&v, (uint64_t)1);
352 }''',
353 name : 'GCC 64bit atomics')
354 pre_args += '-DMISSING_64_BIT_ATOMICS'
355 endif
356
357 # TODO: endian
358 # TODO: powr8
359 # TODO: shared/static? Is this even worth doing?
360
361 # I don't think that I need to set any of the debug stuff, I think meson
362 # handles that for us
363
364 # TODO: ldflags
365
366 # TODO: texture-float (gallium/mesa only)
367
368 # TODO: cross-compiling. I don't think this is relavent to meson
369
370 # FIXME: enable asm when cross compiler
371 # This is doable (autotools does it), but it's not of immediate concern
372 if meson.is_cross_build()
373 message('Cross compiling, disabling asm')
374 with_asm = false
375 endif
376
377 with_asm_arch = ''
378 if with_asm
379 # TODO: SPARC and PPC
380 if host_machine.cpu_family() == 'x86'
381 if ['linux', 'bsd'].contains(host_machine.system()) # FIXME: hurd?
382 with_asm_arch = 'x86'
383 pre_args += ['-DUSE_X86_ASM', '-DUSE_MMX_ASM', '-DUSE_3DNOW_ASM',
384 '-DUSE_SSE_ASM']
385 endif
386 elif host_machine.cpu_family() == 'x86_64'
387 if host_machine.system() == 'linux'
388 with_asm_arch = 'x86_64'
389 pre_args += ['-DUSE_X86_64_ASM']
390 endif
391 elif host_machine.cpu_family() == 'arm'
392 if host_machine.system() == 'linux'
393 with_asm_arch = 'arm'
394 pre_args += ['-DUSE_ARM_ASM']
395 endif
396 elif host_machine.cpu_family() == 'aarch64'
397 if host_machine.system() == 'linux'
398 with_asm_arch = 'aarch64'
399 pre_args += ['-DUSE_AARCH64_ASM']
400 endif
401 endif
402 endif
403
404 # Check for standard headers and functions
405 if cc.has_header_symbol('sys/sysmacros.h', 'major')
406 pre_args += '-DMAJOR_IN_SYSMACROS'
407 elif cc.has_header_symbol('sys/mkdev.h', 'major')
408 pre_args += '-DMAJOR_IN_MKDEV'
409 endif
410
411 foreach h : ['xlocale.h', 'sys/sysctl.h']
412 if cc.has_header(h)
413 pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
414 endif
415 endforeach
416
417 foreach f : ['strtof', 'mkostemp', 'posix_memalign']
418 if cc.has_function(f)
419 pre_args += '-DHAVE_@0@'.format(f.to_upper())
420 endif
421 endforeach
422
423 # strtod locale support
424 if cc.links('''
425 #define _GNU_SOURCE
426 #include <stdlib.h>
427 #include <locale.h>
428 #ifdef HAVE_XLOCALE_H
429 #include <xlocale.h>
430 #endif
431 int main() {
432 locale_t loc = newlocale(LC_CTYPE_MASK, "C", NULL);
433 const char *s = "1.0";
434 char *end;
435 double d = strtod_l(s, end, loc);
436 float f = strtod_l(s, end, loc);
437 freelocale(loc);
438 return 0;
439 }''',
440 extra_args : pre_args,
441 name : 'strtod has locale support')
442 pre_args += '-DHAVE_STRTOD_L'
443 endif
444
445 # Check for some linker flags
446 ld_args_bsymbolic = []
447 if cc.links('int main() { return 0; }', args : '-Wl,-Bsymbolic', name : 'Bsymbolic')
448 ld_args_bsymbolic += '-Wl,-Bsymbolic'
449 endif
450 ld_args_gc_sections = []
451 if cc.links('static char unused() { return 5; } int main() { return 0; }',
452 args : '-Wl,--gc-sections', name : 'gc-sections')
453 ld_args_gc_sections += '-Wl,--gc-sections'
454 endif
455 with_ld_version_script = false
456 if cc.links('int main() { return 0; }',
457 args : '-Wl,--version-script=@0@'.format(
458 join_paths(meson.source_root(), 'build-support/conftest.map')),
459 name : 'version-script')
460 with_ld_version_script = true
461 endif
462 with_ld_dynamic_list = false
463 if cc.links('int main() { return 0; }',
464 args : '-Wl,--dynamic-list=@0@'.format(
465 join_paths(meson.source_root(), 'build-support/conftest.dyn')),
466 name : 'dynamic-list')
467 with_ld_dynamic_list = true
468 endif
469
470 # check for dl support
471 if cc.has_function('dlopen')
472 dep_dl = []
473 else
474 dep_dl = cc.find_library('dl')
475 endif
476 if cc.has_function('dladdr', dependencies : dep_dl)
477 # This is really only required for megadrivers
478 pre_args += '-DHAVE_DLADDR'
479 endif
480
481 if cc.has_function('dl_iterate_phdr')
482 pre_args += '-DHAVE_DL_ITERATE_PHDR'
483 else
484 # TODO: this is required for vulkan
485 endif
486
487 # Determine whether or not the rt library is needed for time functions
488 if cc.has_function('clock_gettime')
489 dep_clock = []
490 else
491 dep_clock = cc.find_library('rt')
492 endif
493
494 # TODO: some of these may be conditional
495 dep_zlib = dependency('zlib', version : '>= 1.2.3')
496 dep_thread = dependency('threads')
497 pre_args += '-DHAVE_PTHREAD'
498 dep_elf = dependency('libelf', required : false)
499 if not dep_elf.found()
500 dep_elf = cc.find_library('elf', required : with_amd_vk) # TODO: clover, r600, radeonsi
501 endif
502 dep_expat = dependency('expat')
503 # this only exists on linux so either this is linux and it will be found, or
504 # its not linux and and wont
505 dep_m = cc.find_library('m', required : false)
506
507 dep_libdrm_amdgpu = []
508 if with_amd_vk
509 dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.82')
510 endif
511
512 llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
513 if with_amd_vk
514 llvm_modules += ['amdgpu', 'bitreader', 'ipo']
515 endif
516 dep_llvm = dependency(
517 'llvm', version : '>= 3.9.0', required : false, modules : llvm_modules,
518 )
519 if with_llvm
520 if dep_llvm.found()
521 _llvm_version = dep_llvm.version().split('.')
522 # Development versions of LLVM have an 'svn' suffix, we don't want that for
523 # our version checks.
524 _llvm_patch = _llvm_version[2]
525 if _llvm_patch.endswith('svn')
526 _llvm_patch = _llvm_patch.split('s')[0]
527 endif
528 pre_args += [
529 '-DHAVE_LLVM=0x0@0@@1@@2@'.format(_llvm_version[0], _llvm_version[1], _llvm_patch),
530 '-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch),
531 ]
532 else
533 if with_amd_vk
534 error('The following drivers requires LLVM: Radv. One of these is enabled, but LLVM was not found.')
535 endif
536 endif
537 elif with_amd_vk
538 error('The following drivers requires LLVM: Radv. One of these is enabled, but LLVM is disabled.')
539 endif
540
541 dep_glvnd = []
542 if with_glvnd
543 dep_glvnd = dependency('libglvnd', version : '>= 0.2.0')
544 pre_args += '-DUSE_LIBGLVND=1'
545 endif
546
547 # TODO: make this conditional
548 dep_valgrind = dependency('valgrind', required : false)
549 if dep_valgrind.found() and with_valgrind
550 pre_args += '-DHAVE_VALGRIND'
551 endif
552
553 # pthread stubs. Lets not and say we didn't
554
555 prog_bison = find_program('bison', required : with_any_opengl)
556 prog_flex = find_program('flex', required : with_any_opengl)
557
558 # TODO: selinux
559 dep_selinux = []
560
561 # TODO: llvm-prefix and llvm-shared-libs
562
563 dep_unwind = dependency('libunwind', required : false)
564 if dep_unwind.found()
565 pre_args += '-DHAVE_LIBUNWIND'
566 endif
567
568 # TODO: flags for opengl, gles, dri
569
570 # TODO: gallium-hud
571
572 # TODO: glx provider
573
574 # TODO: osmesa provider
575
576 # TODO: symbol mangling
577
578 # TODO: egl configuration
579
580 if with_platform_wayland
581 prog_wl_scanner = find_program('wayland-scanner')
582 dep_wl_protocols = dependency('wayland-protocols', version : '>= 1.8')
583 dep_wayland_client = dependency('wayland-client', version : '>=1.11')
584 dep_wayland_server = dependency('wayland-server', version : '>=1.11')
585 else
586 prog_wl_scanner = []
587 dep_wl_protocols = []
588 dep_wayland_client = []
589 dep_wayland_server = []
590 endif
591
592 dep_xcb_dri2 = []
593 dep_xcb_dri3 = []
594 dep_dri2proto = []
595 dep_glproto = []
596 dep_x11 = []
597 dep_xf86vm = []
598 if with_platform_x11
599 if with_glx == 'xlib'
600 # TODO
601 error('TODO')
602 elif with_glx == 'gallium-xlib'
603 # TODO
604 error('TODO')
605 else
606 pre_args += '-DGLX_INDIRECT_RENDERING'
607 if with_glx_direct
608 pre_args += '-DGLX_DIRECT_RENDERING'
609 endif
610 if with_dri_platform == 'drm'
611 pre_args += '-DGLX_USE_DRM'
612 dep_dri2proto = dependency('dri2proto', version : '>= 2.8')
613 dep_x11 = [
614 dependency('x11'),
615 dependency('xext'),
616 dependency('xdamage', version : '>= 1.1'),
617 dependency('xfixes'),
618 dependency('x11-xcb'),
619 dependency('xcb'),
620 dependency('xcb-glx', version : '>= 1.8.1'),
621 ]
622
623 dep_xf86vm = dependency('xxf86vm', required : false)
624 endif
625 # TODO: XF86VIDMODE
626 endif
627 if with_glx != 'disabled'
628 dep_glproto = dependency('glproto', version : '>= 1.4.14')
629 endif
630 if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
631 dep_xcb_dri2 = [
632 dependency('x11-xcb'),
633 dependency('xcb'),
634 dependency('xcb-dri2', version : '>= 1.8'),
635 dependency('xcb-xfixes'),
636 ]
637 pre_args += '-DHAVE_X11_PLATFORM'
638 if with_dri3
639 pre_args += '-DHAVE_DRI3'
640 dep_xcb_dri3 = [
641 dep_xcb_dri2,
642 dependency('xcb-dri3'),
643 dependency('xcb-present'),
644 dependency('xcb-sync'),
645 dependency('xshmfence', version : '>= 1.1'),
646 ]
647 endif
648 endif
649 endif
650
651 # TODO: platforms for !vulkan
652
653 # TODO: osmesa
654
655 # TODO: egl
656
657 # TODO: vallium G3DVL
658
659 # TODO: nine
660
661 # TODO: clover
662
663 # TODO: egl sans x11
664
665 with_gallium_xvmc = false
666 with_gallium_vdpau = false
667 with_gallium_omx = false # this is bellagio
668 with_gallium_va = false
669 with_gallium_media = false
670 dep_va = []
671 _drivers = get_option('gallium-media')
672 if _drivers != ''
673 _split = _drivers.split(',')
674 with_gallium_xvmc = _split.contains('xvmc')
675 with_gallium_vdpau = _split.contains('vdpau')
676 with_gallium_omx = _split.contains('omx')
677 with_gallium_va = _split.contains('va')
678 with_gallium_media = (with_gallium_xvmc or with_gallium_vdpau or
679 with_gallium_omx or with_gallium_va)
680 if with_gallium_media
681 dep_va = [
682 dependency('x11-xcb'),
683 dependency('xcb'),
684 dependency('xcb-dri2', version : '>= 1.8'), # FIXME: dedup version
685 ]
686 endif
687 endif
688
689 # TODO: gallium tests
690
691 # TODO: various libdirs
692
693 # TODO: swr
694
695 # TODO: gallium driver dirs
696
697 # FIXME: this is a workaround for #2326
698 prog_touch = find_program('touch')
699 dummy_cpp = custom_target(
700 'dummy_cpp',
701 output : 'dummy.cpp',
702 command : [prog_touch, '@OUTPUT@'],
703 )
704
705 foreach a : pre_args
706 add_project_arguments(a, language : ['c', 'cpp'])
707 endforeach
708 foreach a : c_args
709 add_project_arguments(a, language : ['c'])
710 endforeach
711 foreach a : cpp_args
712 add_project_arguments(a, language : ['cpp'])
713 endforeach
714
715 inc_include = include_directories('include')
716
717 pkg = import('pkgconfig')
718
719 subdir('include')
720 subdir('src')