From 1b47e1e8f6675e4d03603259c6d91cfa6010986d Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Wed, 24 Feb 2021 12:15:21 +0000 Subject: [PATCH] Fix linux/CI build breaker. --- cmake/compilerFlagsExiv2.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/compilerFlagsExiv2.cmake b/cmake/compilerFlagsExiv2.cmake index d352e38f..d364b695 100644 --- a/cmake/compilerFlagsExiv2.cmake +++ b/cmake/compilerFlagsExiv2.cmake @@ -1,8 +1,14 @@ # These flags only applies to exiv2lib, and the applications, but not to the xmp code +include(CheckCXXCompilerFlag) + if (COMPILER_IS_GCC OR COMPILER_IS_CLANG) # MINGW, Linux, APPLE, CYGWIN if ( EXIV2_TEAM_WARNINGS_AS_ERRORS ) - add_compile_options(-Werror -Wno-error=deprecated-declarations -Wno-error=deprecated-copy) + add_compile_options(-Werror -Wno-error=deprecated-declarations) + check_cxx_compiler_flag(-Wno-error=deprecated-copy DEPRECATED_COPY) + if ( DEPRECATED_COPY) + add_compile_options(-Wno-error=deprecated-copy) + endif () endif () if ( EXIV2_TEAM_EXTRA_WARNINGS )