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 )