CMake: Use -mfpmath gcc option only on x86 CPUs
Fixes compiling with default CMake options on Raspberry PI
@@ -85,7 +85,10 @@ if(CMAKE_COMPILER_IS_GNUCXX)
SET_PROPERTY(CACHE ENABLE_SIMD_FLAGS PROPERTY STRINGS none native SSE3 SSE4.2 AVX AVX2)
if(${ENABLE_SIMD_FLAGS} MATCHES "native")
- add_definitions(-march=native -mfpmath=both)
+ add_definitions(-march=native)
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*|amd64.*|AMD64.*")
+ add_definitions(-mfpmath=both)
+ endif()
message(STATUS "Enabling native optimizations")
elseif(${ENABLE_SIMD_FLAGS} MATCHES "AVX2")
add_definitions(-mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mpopcnt -mavx -mfma -mavx2 -mfpmath=both)
