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