CMake: Fix build with WARNINGS_ARE_ERRORS=ON and gcc 9.3.0

Add -Wno-error=format-overflow. This is similar to what is done in
qt_common.prf, however we don't turn the warning off completely.
For now at least.

Change-Id: I93c20064759dea43309c3a17de4d733ede9ca2cb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2020-04-02 20:24:04 +02:00
parent ec07f83190
commit da6f021b52

View File

@ -28,6 +28,8 @@ function(qt_internal_set_warnings_are_errors_flags target)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.0.0")
# GCC 9 introduced these but we are not clean for it.
list(APPEND flags -Wno-error=deprecated-copy -Wno-error=redundant-move -Wno-error=init-list-lifetime)
# GCC 9 introduced -Wformat-overflow in -Wall, but it is buggy:
list(APPEND flags -Wno-error=format-overflow)
endif()
# Work-around for bug https://code.google.com/p/android/issues/detail?id=58135