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