Clone of mesa.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

meson.build 19KB

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