radv: enable lowering of GS intrinsics for the LLVM backend
[mesa.git] / meson.build
index 35cd2e6f632770b8e1c9c1f98a6821bde876ff5e..cb275e7dcc19adb7d63b5c1d00f7e049edb8dfef 100644 (file)
@@ -22,7 +22,7 @@ project(
   'mesa',
   ['c', 'cpp'],
   version : run_command(
-    [find_program('python', 'python2', 'python3'), 'bin/meson_get_version.py']
+    [find_program('python', 'python3'), 'bin/meson_get_version.py']
   ).stdout(),
   license : 'MIT',
   meson_version : '>= 0.46',
@@ -34,6 +34,10 @@ cpp = meson.get_compiler('cpp')
 
 null_dep = dependency('', required : false)
 
+if get_option('layout') != 'mirror'
+  error('`mirror` is the only build directory layout supported')
+endif
+
 # Arguments for the preprocessor, put these in a separate array from the C and
 # C++ (cpp in meson terminology) arguments since they need to be added to the
 # default arguments for both C and C++.
@@ -244,10 +248,6 @@ with_amd_vk = _vulkan_drivers.contains('amd')
 with_freedreno_vk = _vulkan_drivers.contains('freedreno')
 with_any_vk = _vulkan_drivers.length() != 0 and _vulkan_drivers != ['']
 
-if with_freedreno_vk and get_option('I-love-half-baked-turnips') != true
-  error('Cannot enable freedreno vulkan driver')
-endif
-
 if with_dri_swrast and (with_gallium_softpipe or with_gallium_swr)
   error('Only one swrast provider can be built')
 endif
@@ -436,6 +436,7 @@ if with_vulkan_icd_dir == ''
   with_vulkan_icd_dir = join_paths(get_option('datadir'), 'vulkan/icd.d')
 endif
 
+# GNU/Hurd includes egl_dri2, without drm.
 with_dri2 = (with_dri or with_any_vk) and (with_dri_platform == 'drm' or
   host_machine.system() == 'gnu')
 _dri3 = get_option('dri3')
@@ -785,6 +786,9 @@ if with_platform_android
     dependency('hardware'),
     dependency('sync'),
   ]
+  if with_gallium
+    dep_android += dependency('backtrace')
+  endif
   if get_option('platform-sdk-version') >= 26
     dep_android += dependency('nativewindow')
   endif
@@ -932,7 +936,11 @@ if cc.get_id() == 'msvc'
                '/wd4756',  # overflow in constant arithmetic
                '/wd4800',  # forcing value to bool 'true' or 'false' (performance warning)
                '/wd4996',  # disabled deprecated POSIX name warnings
-               '/wd4291']  # no matching operator delete found
+               '/wd4291',  # no matching operator delete found
+               '/wd4146',  # unary minus operator applied to unsigned type, result still unsigned
+               '/wd4200',  # nonstandard extension used: zero-sized array in struct/union
+               '/wd4624',  # destructor was implicitly defined as deleted [from LLVM]
+              ]
     if cc.has_argument(a)
       c_args += a
     endif
@@ -957,6 +965,7 @@ else
     '-fno-math-errno',
     '-fno-trapping-math',
     '-Qunused-arguments',
+    '-fno-common',
   ]
   # MinGW chokes on format specifiers and I can't get it all working
   if not (cc.get_id() == 'gcc' and host_machine.system() == 'windows')
@@ -1178,6 +1187,11 @@ if host_machine.system() != 'windows'
   endif
 endif
 
+if cc.has_member('struct dirent', 'd_type', prefix: '''#include <sys/types.h>
+   #include <dirent.h>''')
+   pre_args += '-DHAVE_DIRENT_D_TYPE'
+endif
+
 # strtod locale support
 if cc.links('''
     #define _GNU_SOURCE
@@ -1353,7 +1367,8 @@ endforeach
 with_gallium_drisw_kms = false
 dep_libdrm = dependency(
   'libdrm', version : '>=' + _drm_ver,
-  required : with_dri2 or with_dri3
+  # GNU/Hurd includes egl_dri2, without drm.
+  required : (with_dri2 and host_machine.system() != 'gnu') or with_dri3
 )
 if dep_libdrm.found()
   pre_args += '-DHAVE_LIBDRM'
@@ -1501,6 +1516,14 @@ if host_machine.system() == 'windows'
   endif
 else
   prog_bison = find_program('bison', required : with_any_opengl)
+
+  # Disable deprecated keyword warnings, since we have to use them for
+  # old-bison compat.  See discussion in
+  # https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2161
+  if meson.version().version_compare('>= 0.52.0') and find_program('bison', required : false, version : '> 2.3').found()
+    prog_bison = [prog_bison, '-Wno-deprecated']
+  endif
+
   prog_flex = find_program('flex', required : with_any_opengl)
 endif