Skip to content

Commit

Permalink
Merge pull request #344 from xhochy/no-march-native-apple
Browse files Browse the repository at this point in the history
Don't set march=native on Apple Silicon
  • Loading branch information
daanx committed Dec 17, 2020
2 parents bb38602 + 62b6ccb commit b650aa9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,11 @@ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU|Intel" AND NOT CMAKE_SYSTEM
endif()

# Architecture flags
if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm")
list(APPEND mi_cflags -march=native)
if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm" AND NOT APPLE)
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
Expand Down

0 comments on commit b650aa9

Please sign in to comment.