summaryrefslogtreecommitdiff
path: root/chromium/third_party/dav1d/libdav1d/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/dav1d/libdav1d/meson.build')
-rw-r--r--chromium/third_party/dav1d/libdav1d/meson.build48
1 files changed, 32 insertions, 16 deletions
diff --git a/chromium/third_party/dav1d/libdav1d/meson.build b/chromium/third_party/dav1d/libdav1d/meson.build
index a312ae011fa..cee8b791eed 100644
--- a/chromium/third_party/dav1d/libdav1d/meson.build
+++ b/chromium/third_party/dav1d/libdav1d/meson.build
@@ -30,7 +30,7 @@ project('dav1d', ['c'],
'b_ndebug=if-release'],
meson_version: '>= 0.49.0')
-dav1d_soname_version = '6.6.0'
+dav1d_soname_version = '6.8.0'
dav1d_api_version_array = dav1d_soname_version.split('.')
dav1d_api_version_major = dav1d_api_version_array[0]
dav1d_api_version_minor = dav1d_api_version_array[1]
@@ -63,7 +63,7 @@ endforeach
# ASM option
is_asm_enabled = (get_option('enable_asm') == true and
(host_machine.cpu_family() == 'x86' or
- (host_machine.cpu_family() == 'x86_64' and cc.get_define('__ILP32__') == '') or
+ (host_machine.cpu_family() == 'x86_64' and cc.get_define('__ILP32__').strip() == '') or
host_machine.cpu_family() == 'aarch64' or
host_machine.cpu_family().startswith('arm') or
host_machine.cpu() == 'ppc64le'))
@@ -73,6 +73,9 @@ if is_asm_enabled and get_option('b_sanitize') == 'memory'
error('asm causes false positive with memory sanitizer. Use \'-Denable_asm=false\'.')
endif
+cdata.set10('TRIM_DSP_FUNCTIONS', get_option('trim_dsp') == 'true' or
+ (get_option('trim_dsp') == 'if-release' and get_option('buildtype') == 'release'))
+
# Logging option
cdata.set10('CONFIG_LOG', get_option('logging'))
@@ -84,16 +87,11 @@ cdata.set10('CONFIG_LOG', get_option('logging'))
test_args = []
optional_arguments = []
+optional_link_arguments = []
-if host_machine.system() == 'linux'
+if host_machine.system() in ['linux', 'gnu']
test_args += '-D_GNU_SOURCE'
add_project_arguments('-D_GNU_SOURCE', language: 'c')
-elif host_machine.system() == 'darwin'
- test_args += '-D_DARWIN_C_SOURCE'
- add_project_arguments('-D_DARWIN_C_SOURCE', language: 'c')
-else
- test_args += '-D_POSIX_C_SOURCE=200112L'
- add_project_arguments('-D_POSIX_C_SOURCE=200112L', language: 'c')
endif
if host_machine.system() == 'windows'
@@ -109,6 +107,18 @@ if host_machine.system() == 'windows'
cdata.set('ftello', '_ftelli64')
endif
+ if host_machine.cpu_family() == 'x86_64'
+ if cc.get_argument_syntax() != 'msvc'
+ optional_link_arguments += '-Wl,--dynamicbase,--nxcompat,--tsaware,--high-entropy-va'
+ endif
+ elif host_machine.cpu_family() == 'x86' or host_machine.cpu_family() == 'arm'
+ if cc.get_argument_syntax() == 'msvc'
+ optional_link_arguments += '/largeaddressaware'
+ else
+ optional_link_arguments += '-Wl,--dynamicbase,--nxcompat,--tsaware,--large-address-aware'
+ endif
+ endif
+
# On Windows, we use a compatibility layer to emulate pthread
thread_dependency = []
thread_compat_dep = declare_dependency(sources : files('src/win32/thread.c'))
@@ -132,7 +142,7 @@ else
rt_dependency = []
if cc.has_function('clock_gettime', prefix : '#include <time.h>', args : test_args)
cdata.set('HAVE_CLOCK_GETTIME', 1)
- elif host_machine.system() != 'darwin'
+ elif host_machine.system() not in ['darwin', 'ios', 'tvos']
rt_dependency = cc.find_library('rt', required: false)
if not cc.has_function('clock_gettime', prefix : '#include <time.h>', args : test_args, dependencies : rt_dependency)
error('clock_gettime not found')
@@ -245,6 +255,10 @@ if cc.has_function('pthread_getaffinity_np', prefix : pthread_np_prefix, args :
cdata.set('HAVE_PTHREAD_GETAFFINITY_NP', 1)
endif
+if cc.compiles('int x = _Generic(0, default: 0);', name: '_Generic', args: test_args)
+ cdata.set('HAVE_C11_GENERIC', 1)
+endif
+
# Compiler flag tests
if cc.has_argument('-fvisibility=hidden')
@@ -286,13 +300,14 @@ if (get_option('buildtype') != 'debug' and get_option('buildtype') != 'plain')
optional_arguments += '-ffast-math'
endif
-if (host_machine.system() == 'darwin' and cc.get_id() == 'clang' and
+if (host_machine.system() in ['darwin', 'ios', 'tvos'] and cc.get_id() == 'clang' and
cc.version().startswith('11'))
# Workaround for Xcode 11 -fstack-check bug, see #301
optional_arguments += '-fno-stack-check'
endif
add_project_arguments(cc.get_supported_arguments(optional_arguments), language : 'c')
+add_project_link_arguments(cc.get_supported_link_arguments(optional_link_arguments), language : 'c')
# libFuzzer related things
fuzzing_engine = get_option('fuzzing_engine')
@@ -327,7 +342,7 @@ if host_machine.cpu_family().startswith('x86')
stack_alignment = 16
endif
else
- if host_machine.system() == 'linux' or host_machine.system() == 'darwin'
+ if host_machine.system() == 'linux' or host_machine.system() in ['darwin', 'ios', 'tvos']
stack_alignment = 16
elif cc.has_argument('-mpreferred-stack-boundary=4')
stackalign_flag = ['-mpreferred-stack-boundary=4']
@@ -388,7 +403,7 @@ if host_machine.cpu_family().startswith('x86')
cdata_asm.set10('PIC', true)
# Convert SSE asm into (128-bit) AVX when compiler flags are set to use AVX instructions
- cdata_asm.set10('FORCE_VEX_ENCODING', cc.get_define('__AVX__') != '')
+ cdata_asm.set10('FORCE_VEX_ENCODING', cc.get_define('__AVX__').strip() != '')
endif
cdata.set10('ARCH_PPC64LE', host_machine.cpu() == 'ppc64le')
@@ -396,7 +411,7 @@ cdata.set10('ARCH_PPC64LE', host_machine.cpu() == 'ppc64le')
# meson's cc.symbols_have_underscore_prefix() is unfortunately unrelieably
# when additional flags like '-fprofile-instr-generate' are passed via CFLAGS
# see following meson issue https://github.com/mesonbuild/meson/issues/5482
-if (host_machine.system() == 'darwin' or
+if (host_machine.system() in ['darwin', 'ios', 'tvos'] or
(host_machine.system() == 'windows' and host_machine.cpu_family() == 'x86'))
cdata.set10('PREFIX', true)
cdata_asm.set10('PREFIX', true)
@@ -430,7 +445,7 @@ if is_asm_enabled and host_machine.cpu_family().startswith('x86')
if host_machine.system() == 'windows'
nasm_format = 'win'
- elif host_machine.system() == 'darwin'
+ elif host_machine.system() in ['darwin', 'ios', 'tvos']
nasm_format = 'macho'
else
nasm_format = 'elf'
@@ -459,7 +474,8 @@ use_gaspp = false
if (is_asm_enabled and
(host_machine.cpu_family() == 'aarch64' or
host_machine.cpu_family().startswith('arm')) and
- cc.get_argument_syntax() == 'msvc')
+ cc.get_argument_syntax() == 'msvc' and
+ (cc.get_id() != 'clang-cl' or meson.version().version_compare('<0.58.0')))
gaspp = find_program('gas-preprocessor.pl')
use_gaspp = true
gaspp_gen = generator(gaspp,