1
0
Fork 0
mirror of https://git.freebsd.org/ports.git synced 2025-07-03 02:20:33 -04:00
ports/graphics/exiv2/files/patch-cmake_compilerFlags.cmake
Piotr Kubaj 73cc729afe graphics/exiv2: fix build on ARM and PPC platforms
exiv2 added -fcf-protection, which is not supported on either ARM or PPC.
1ea63ccb34 fixes that but only for ARM.

Merge this commit and add modify it to also fix PPC. This is likely the wrong approach, since -fcf-protection seems to be available only on amd64, but this is the approach that upstream chose.

MFH:		2020Q3 (fix build blanket)
2020-07-09 11:53:22 +00:00

15 lines
846 B
CMake

--- cmake/compilerFlags.cmake.orig 2020-07-09 11:24:28 UTC
+++ cmake/compilerFlags.cmake
@@ -26,7 +26,11 @@ if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CY
# This fails under Fedora, MinGW GCC 8.3.0 and CYGWIN/MSYS 9.3.0
if (NOT (MINGW OR CMAKE_HOST_SOLARIS OR CYGWIN OR MSYS) )
if (COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
- add_compile_options(-fstack-clash-protection -fcf-protection)
+ if (NOT (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "powerpc"))
+ add_compile_options(-fstack-clash-protection -fcf-protection)
+ else()
+ add_compile_options(-fstack-clash-protection)
+ endif()
endif()
if( (COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0) # Not in GCC 4.8