cmake: Don't enable any -Werror flags without opt-in.

This commit is contained in:
whitequark 2021-02-26 00:33:05 +00:00 committed by GitHub
parent de107da5b3
commit a0af4d8768
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,7 +107,7 @@ if (MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W4 /wd4100 /wd4244 /wd4125 /wd4800 /wd4456 /wd4458 /wd4305 /wd4459 /wd4121 /wd4996 /wd4127")
else()
# N.B. the -Wno-array-bounds is to work around a false positive in GCC 9
set(WARN_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-array-bounds -Werror=sign-compare -Werror=return-type")
set(WARN_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-array-bounds")
if (WERROR)
set(WARN_FLAGS "${WARN_FLAGS} -Werror")
endif()