Skip to content

Commit

Permalink
Merge pull request #2459 from barracuda156/ppc
Browse files Browse the repository at this point in the history
UserOverride.cmake: fix native optflag for PowerPC
  • Loading branch information
certik authored Jan 10, 2024
2 parents f9ab31e + 9c4433e commit 0d43cc4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmake/UserOverride.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# g++
set(common "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "${common} -O3 -march=native -funroll-loops -DNDEBUG")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "ppc|powerpc")
set(native "-mtune=native")
else ()
set(native "-march=native")
endif ()
set(CMAKE_CXX_FLAGS_RELEASE_INIT "${common} -O3 ${native} -funroll-loops -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG_INIT "${common} -g -ggdb")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
# icpc
Expand Down

0 comments on commit 0d43cc4

Please sign in to comment.