diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2022-10-07 16:13:49 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2022-10-10 12:23:12 +0300 |
commit | 5b07b4256617913ec81277f07af592ebd62b11a3 (patch) | |
tree | 1aedba7eb72456a460bd3f65aab402f2a497eed0 | |
parent | cac76e4b6641dd26dd87fd749261526ae7469d3e (diff) |
Handle host_machine.system() 'ios' and 'tvos' the same way as 'darwin'
Despite not being documented in Meson's list of canonical system names,
Meson does accept 'ios' mostly a synonym for darwin.
By using 'ios' instead of darwin, it allows distinguishing between the
two in the cases where that is necessary. Therefore, within dav1d, allow
using the 'ios' name as alias for 'darwin' for system name, to allow
using cross files that does this distinction.
meson itself also allows 'tvos' in addition to 'ios' in the internal
`is_darwin()` function, as such all 3 are handled the same here.
-rw-r--r-- | meson.build | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/meson.build b/meson.build index edb5415..99bfea5 100644 --- a/meson.build +++ b/meson.build @@ -92,7 +92,7 @@ optional_link_arguments = [] if host_machine.system() == 'linux' test_args += '-D_GNU_SOURCE' add_project_arguments('-D_GNU_SOURCE', language: 'c') -elif host_machine.system() == 'darwin' +elif host_machine.system() in ['darwin', 'ios', 'tvos'] test_args += '-D_DARWIN_C_SOURCE' add_project_arguments('-D_DARWIN_C_SOURCE', language: 'c') else @@ -148,7 +148,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') @@ -306,7 +306,7 @@ 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' @@ -348,7 +348,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'] @@ -417,7 +417,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) @@ -451,7 +451,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' |