--- /dev/null
+--- exiv2-0.27.3-Source/cmake/compilerFlags.cmake.orig 2020-06-30 15:33:22.000000000 +0200
++++ exiv2-0.27.3-Source/cmake/compilerFlags.cmake 2020-11-04 00:53:19.007731270 +0100
+@@ -1,4 +1,5 @@
+ # These flags applies to exiv2lib, the applications, and to the xmp code\r
++include(CheckCXXCompilerFlag)\r
+ \r
+ if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN\r
+ if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)\r
+@@ -25,13 +26,16 @@
+ \r
+ # This fails under Fedora, MinGW GCC 8.3.0 and CYGWIN/MSYS 9.3.0\r
+ if (NOT (MINGW OR CMAKE_HOST_SOLARIS OR CYGWIN OR MSYS) )\r
+- if (COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)\r
+- add_compile_options(-fstack-clash-protection -fcf-protection)\r
++ check_cxx_compiler_flag(-fstack-clash-protection HAS_FSTACK_CLASH_PROTECTION)\r
++ check_cxx_compiler_flag(-fcf-protection HAS_FCF_PROTECTION)\r
++ check_cxx_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG)\r
++ if(HAS_FSTACK_CLASH_PROTECTION)\r
++ add_compile_options(-fstack-clash-protection)\r
+ endif()\r
+-\r
+- if( (COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0) # Not in GCC 4.8\r
+- OR (COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 3.7) # Not in Clang 3.4.2\r
+- )\r
++ if(HAS_FCF_PROTECTION)\r
++ add_compile_options(-fcf-protection)\r
++ endif()\r
++ if(HAS_FSTACK_PROTECTOR_STRONG)\r
+ add_compile_options(-fstack-protector-strong)\r
+ endif()\r
+ endif()\r
# Source0-md5: 68a59595e8617284b2e1eee528ae1f77
Patch0: cmake.patch
Patch1: %{name}-no-xmpsdk-install.patch
+Patch2: compiler_flags.patch
URL: https://www.exiv2.org/
BuildRequires: cmake >= 3.3.2
%{?with_curl:BuildRequires: curl-devel}
%setup -q -n %{name}-%{version}-Source
%patch0 -p1
%patch1 -p1
+%patch2 -p1
%build
install -d build