meson: Check arm neon support before parsing neon option

The main if statment for the NEON option has been quite convoluted. The
previous commits reduced what it does to a simple case: check NEON
support and set have_neon on 32-bit ARM CPUs. Do that near the
architecture definitions.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
This commit is contained in:
Alper Nebi Yasak 2024-10-30 03:05:36 +03:00 committed by Arun Raghavan
parent 6c914be933
commit b7a194f824

View File

@ -131,6 +131,9 @@ if host_machine.cpu_family() == 'arm'
have_armv7 = true
arch_cflags += ['-DWEBRTC_ARCH_ARM_V7']
endif
if cc.compiles('#include <arm_neon.h>', args : '-mfpu=neon')
have_neon = true
endif
endif
if cc.compiles('''#ifndef __aarch64__
#error no aarch64 arch
@ -163,13 +166,6 @@ if ['x86', 'x86_64'].contains(host_machine.cpu_family())
endif
neon_opt = get_option('neon')
if neon_opt != 'no' and not have_neon
if neon_opt != 'runtime'
if cc.compiles('#include <arm_neon.h>', args : '-mfpu=neon')
have_neon = true
endif
endif
endif
if neon_opt == 'runtime'
warning('webrtc cannot check NEON support at runtime, will build without NEON')
have_neon = false