1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-13 03:09:51 +03:00
aports/community/drawpile/cmake-detect-arch.patch

24 lines
804 B
Diff

Fix g++ compile option error on ppc64le and riscv64.
ppc64le: `unrecognized command-line option '-march=native'`
riscv64: `'-march=native': ISA string must begin with rv32 or rv64`
--- a/cmake/DrawpileCompilerOptions.cmake
+++ b/cmake/DrawpileCompilerOptions.cmake
@@ -83,8 +83,14 @@
endif()
if(ENABLE_ARCH_NATIVE)
- add_compile_options(-march=native)
- endif()
+ if (CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le")
+ add_compile_options(-mcpu=powerpc64le)
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64")
+ add_compile_options(-march=rv64id)
+ else()
+ add_compile_options(-march=native)
+ endif()
+ endif()
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105725
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.2)