Skip to content

Commit

Permalink
fix mac apple silicon build
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed May 29, 2024
1 parent 8e10751 commit 5a24405
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CMake/unix_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ macro(os_set_flags)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-multichar -Wsequence-point -Wformat -Wformat-security")

execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE MACHINE)
if(${MACHINE} MATCHES "arm-*")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic")
elseif(${MACHINE} MATCHES "aarch64-*")
if(${MACHINE} MATCHES "arm64-*" OR ${MACHINE} MATCHES "aarch64-*")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mstrict-align -ftree-vectorize")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mstrict-align -ftree-vectorize")
elseif(${MACHINE} MATCHES "arm-*")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic")
elseif(${MACHINE} MATCHES "powerpc64(le)?-linux-gnu")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftree-vectorize")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize")
Expand Down

0 comments on commit 5a24405

Please sign in to comment.