Skip to content

Commit 0d43cc4

Browse files
authored
Merge pull request #2459 from barracuda156/ppc
UserOverride.cmake: fix native optflag for PowerPC
2 parents f9ab31e + 9c4433e commit 0d43cc4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmake/UserOverride.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
1010
# g++
1111
set(common "-Wall -Wextra")
12-
set(CMAKE_CXX_FLAGS_RELEASE_INIT "${common} -O3 -march=native -funroll-loops -DNDEBUG")
12+
if (CMAKE_SYSTEM_PROCESSOR MATCHES "ppc|powerpc")
13+
set(native "-mtune=native")
14+
else ()
15+
set(native "-march=native")
16+
endif ()
17+
set(CMAKE_CXX_FLAGS_RELEASE_INIT "${common} -O3 ${native} -funroll-loops -DNDEBUG")
1318
set(CMAKE_CXX_FLAGS_DEBUG_INIT "${common} -g -ggdb")
1419
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
1520
# icpc

0 commit comments

Comments
 (0)