Cmake build: Fix the invalid test for '-Wno-deprecated-copy' flag

The original test was always successfull, even if the flag was invalid.
But checking for '-Wdeprecated-copy' instead yields to error if the warning does not exist.
Existent warning for 'deprecated-copy' implies that 'no-deprecated-copy' also exist.
This commit is contained in:
Kornel Benko 2021-09-29 17:53:50 +02:00
parent 0862042b28
commit c26db650a1

View File

@ -714,7 +714,7 @@ else()
# check_cxx_source_compiles("..." HAVE_DEF_MAKE_UNIQUE) # check_cxx_source_compiles("..." HAVE_DEF_MAKE_UNIQUE)
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
unset(CHECK_WNODEPRECATEDCOPY_FLAG CACHE) unset(CHECK_WNODEPRECATEDCOPY_FLAG CACHE)
CHECK_CXX_COMPILER_FLAG("-Wno-deprecated-copy" CHECK_WNODEPRECATEDCOPY_FLAG) CHECK_CXX_COMPILER_FLAG("-Wdeprecated-copy" CHECK_WNODEPRECATEDCOPY_FLAG)
if(${CHECK_WNODEPRECATEDCOPY_FLAG}) if(${CHECK_WNODEPRECATEDCOPY_FLAG})
set(LYX_CXX_FLAGS "-Wall -Wextra -Wno-deprecated-copy ${LYX_GCC11_MODE}${LYX_CXX_FLAGS}") set(LYX_CXX_FLAGS "-Wall -Wextra -Wno-deprecated-copy ${LYX_GCC11_MODE}${LYX_CXX_FLAGS}")
else() else()