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