From f92eb50eb7995d799a0dd6f7c77e57215e826b9a Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Wed, 7 Feb 2024 11:24:09 +0800 Subject: [PATCH] compilers.cmake: use correct optflags -march= is not supported on PowerPC arch, -mtune= and -mcpu= are. --- build/cmake/compilers.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/cmake/compilers.cmake b/build/cmake/compilers.cmake index 07729e3cf..3f6fa789b 100644 --- a/build/cmake/compilers.cmake +++ b/build/cmake/compilers.cmake @@ -17,7 +17,11 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") # AN target_compile_options(nana PRIVATE -Wall) # todo: set in target property of nana - set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -mtune=native -DNDEBUG") + if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc|powerpc") + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -mcpu=native -mtune=native -DNDEBUG") + else() + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -mtune=native -DNDEBUG") + endif() set(THREADS_PREFER_PTHREAD_FLAG ON) # todo - test this find_package(Threads REQUIRED)