From fb54324f5612d5565cfbf366d295799a0641dd22 Mon Sep 17 00:00:00 2001 From: Thomas Debrunner Date: Mon, 8 Nov 2021 22:26:41 +0100 Subject: [PATCH] gyro-fft: Disable asm-operand-widths warning on apple silicon. The warning is caused by unused functions only. As with compiling for x86, the functions containing assembly never get used, but since the apple silicon is also an ARM target, they trigger a warning. --- src/modules/gyro_fft/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/gyro_fft/CMakeLists.txt b/src/modules/gyro_fft/CMakeLists.txt index 032109e883..85c6bbf461 100644 --- a/src/modules/gyro_fft/CMakeLists.txt +++ b/src/modules/gyro_fft/CMakeLists.txt @@ -38,6 +38,11 @@ if(${PX4_PLATFORM} MATCHES "NuttX") add_compile_options(-DARM_MATH_DSP) endif() +# Disable 32-bit assembly warnings on apple silicon. Triggered by unused code only. +if(${PX4_PLATFORM} MATCHES "posix" AND APPLE AND ${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm64") + add_compile_options(-Wno-asm-operand-widths) +endif() + add_compile_options($<$:-Wno-nested-externs>) px4_add_module(