From b7a194f824a11b8b6e26135eb1b00186678926c5 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Wed, 30 Oct 2024 03:05:36 +0300 Subject: [PATCH] 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 --- meson.build | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 7b46c84..ce2f901 100644 --- a/meson.build +++ b/meson.build @@ -131,6 +131,9 @@ if host_machine.cpu_family() == 'arm' have_armv7 = true arch_cflags += ['-DWEBRTC_ARCH_ARM_V7'] endif + if cc.compiles('#include ', 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 ', 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