From fc5a4946afb58ef002e135fff3c6c0649fbfbfe3 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Wed, 30 Oct 2024 03:11:57 +0300 Subject: [PATCH] meson: Set 'auto' as the default neon option value The default for the neon build option is 'no', which disabled NEON code for 32-bit ARM but enabled it for ARM64. Now that 'no' can disable NEON code for ARM64, the default should be 'auto' which would enable it where possible. Handle the 'auto' value, and set it as the default. Signed-off-by: Alper Nebi Yasak --- meson.build | 9 +++++++++ meson_options.txt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ce2f901..5d2fb8a 100644 --- a/meson.build +++ b/meson.build @@ -166,6 +166,15 @@ if ['x86', 'x86_64'].contains(host_machine.cpu_family()) endif neon_opt = get_option('neon') +if neon_opt == 'auto' + if have_arm64 + neon_opt = 'yes' + elif have_neon + neon_opt = 'runtime' + else + neon_opt = 'no' + endif +endif if neon_opt == 'runtime' warning('webrtc cannot check NEON support at runtime, will build without NEON') have_neon = false diff --git a/meson_options.txt b/meson_options.txt index d08f356..45c4bfb 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -2,7 +2,7 @@ option('gnustl', type: 'feature', value: 'auto', description: 'Use gnustl for a c++ library implementation (only used on Android)') option('neon', type: 'combo', - choices: ['no', 'yes', 'auto', 'runtime'], + choices: ['auto', 'yes', 'runtime', 'no'], description: 'Enable NEON optimisations') option('inline-sse', type: 'boolean', value: true,