From 62b6ccb03e8381b094eb3a92c6840fe4d2daf18f Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Tue, 15 Dec 2020 11:03:20 +0100 Subject: [PATCH] Check for march=native before using it --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c2deae13..ca7a6faa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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