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