Skip to content

Commit 8bd6bad

Browse files
authored
Merge pull request #22 from barracuda156/ppc
Do not use invalid -march= flag on PPC, fix the build
2 parents 08b72b2 + df55144 commit 8bd6bad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

GKlibSystem.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ if(CMAKE_COMPILER_IS_GNUCC)
3333
set(GKlib_COPTIONS "${GKlib_COPTIONS} -std=c99 -fno-strict-aliasing")
3434
if(VALGRIND)
3535
set(GKlib_COPTIONS "${GK_COPTIONS} -march=x86-64 -mtune=generic")
36+
else()
37+
# -march=native is not a valid flag on PPC:
38+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "power|ppc|powerpc|ppc64|powerpc64" OR (APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc|ppc64"))
39+
set(GKlib_COPTIONS "${GKlib_COPTIONS} -mtune=native")
3640
else()
3741
set(GKlib_COPTIONS "${GKlib_COPTIONS} -march=native")
42+
endif()
3843
endif(VALGRIND)
3944
if(NOT MINGW)
4045
set(GKlib_COPTIONS "${GKlib_COPTIONS} -fPIC")

0 commit comments

Comments
 (0)