Check for march=native before using it

This commit is contained in:
Uwe L. Korn 2020-12-15 11:03:20 +01:00
parent d7f3d7679a
commit 62b6ccb03e

View File

@ -187,7 +187,10 @@ endif()
# Architecture flags
if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm" AND NOT APPLE)
list(APPEND mi_cflags -march=native)
check_cxx_compiler_flag(-march=native CXX_SUPPORTS_MARCH_NATIVE)
if (CXX_SUPPORTS_MARCH_NATIVE)
list(APPEND mi_cflags -march=native)
endif()
endif()
# extra needed libraries