meson: Fix detection of AArch64 on Linux
Neither __ARM_EABI__ nor __ARM_NEON__ are defined by GCC for AArch64,
and -mfpu=neon is not required as NEON is always supported in AArch64.
@@ -10,6 +10,7 @@ project('graphene', 'c',
cc = meson.get_compiler('c')
host_system = host_machine.system()
+host_cpu_family = host_machine.cpu_family()
add_project_arguments([ '-D_GNU_SOURCE' ], language: 'c')
@@ -352,6 +353,7 @@ neon_cflags = []
if get_option('arm_neon')
neon_prog = '''
#if !defined (_MSC_VER) || defined (__clang__)
+# if !defined (_M_ARM64) && !defined (__aarch64__)
# ifndef __ARM_EABI__
# error "EABI is required (to be sure that calling conventions are compatible)"
# endif
@@ -359,6 +361,7 @@ if get_option('arm_neon')
# error "No ARM NEON instructions available"
# endif
# endif
+#endif
#include <arm_neon.h>
int main () {
const float32_t __v[4] = { 1, 2, 3, 4 }; \
@@ -376,7 +379,7 @@ int main () {
test_neon_cflags = []
- if cc.get_id() != 'msvc'
+ if cc.get_id() != 'msvc' and host_cpu_family != 'aarch64'
test_neon_cflags += ['-mfpu=neon']
endif
