Skip to content

Commit

Permalink
Arm toolchains prefer -mcpu=native
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalobg committed Aug 14, 2024
1 parent 6f0c2a1 commit 084ef3b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ option(BUILD_NATIVE "Builds for the current systems CPU and GPU architecture." O
set(DEFAULT_DEBUG_FLAGS -O2 -fno-omit-frame-pointer)
set(DEFAULT_RELEASE_FLAGS -O3)
if (BUILD_NATIVE)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
set(DEFAULT_RELEASE_FLAGS ${DEFAULT_RELEASE_FLAGS} -mcpu=native)
else()
set(DEFAULT_RELEASE_FLAGS ${DEFAULT_RELEASE_FLAGS} -march=native)
endif()
endif()

macro(hint_flag FLAG DESCRIPTION)
Expand Down

0 comments on commit 084ef3b

Please sign in to comment.