[find_program('python', 'python2', 'python3'), 'bin/meson_get_version.py']
).stdout(),
license : 'MIT',
- meson_version : '>= 0.45',
+ meson_version : '>= 0.46',
default_options : ['buildtype=debugoptimized', 'b_ndebug=if-release', 'c_std=c99', 'cpp_std=c++11']
)
if host_machine.system() == 'darwin'
with_dri_platform = 'apple'
+ pre_args += '-DBUILDING_MESA'
elif ['windows', 'cygwin'].contains(host_machine.system())
with_dri_platform = 'windows'
elif system_has_kms_drm
endif
endif
-pre_args += '-DGLX_USE_TLS'
+# Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS.
+if not with_platform_android or get_option('platform-sdk-version') >= 29
+ pre_args += '-DUSE_ELF_TLS'
+endif
+
if with_glx != 'disabled'
if not (with_platform_x11 and with_any_opengl)
error('Cannot build GLX support without X11 platform support and at least one OpenGL API')
endif
endforeach
-foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create']
+foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create', 'random_r']
if cc.has_function(f)
pre_args += '-DHAVE_@0@'.format(f.to_upper())
endif
endforeach
+if cc.has_header_symbol('errno.h', 'program_invocation_name',
+ args : '-D_GNU_SOURCE')
+ pre_args += '-DHAVE_PROGRAM_INVOCATION_NAME'
+elif with_tools.contains('intel')
+ error('Intel tools require the program_invocation_name variable')
+endif
+
# strtod locale support
if cc.links('''
#define _GNU_SOURCE