From 2ff7922b0f5f6833c81933efed785290b4931d38 Mon Sep 17 00:00:00 2001 From: William Sackfield Date: Sat, 6 Nov 2021 07:28:15 +1100 Subject: [PATCH] Only add the arch native flag on x86 * Apple devices with M1 chips do not support -march=native --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a93e06f4e..a8003677c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,10 @@ set (fasttext_VERSION_MINOR 1) include_directories(fasttext) -set(CMAKE_CXX_FLAGS " -pthread -std=c++11 -funroll-loops -O3 -march=native") +set(CMAKE_CXX_FLAGS " -pthread -std=c++11 -funroll-loops -O3") +if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(AMD64|amd64)|(^i.86$)") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") +endif () set(HEADER_FILES src/args.h