cmake: take over some fatal warnings from autotools

Adopt various fatal warnings from the autotools build system
to see corresponding build errors also in cmake.
This commit is contained in:
Ralf Habacker 2021-11-11 13:24:06 +01:00 committed by Simon McVittie
parent 31e8a2af0b
commit 956aac65d4

View file

@ -271,7 +271,13 @@ if(MSVC)
else()
set(WARNINGS "sign-compare")
set(WARNINGS_DISABLED "")
set(WARNINGS_ERRORS "")
set(WARNINGS_ERRORS
missing-prototypes
strict-prototypes
declaration-after-statement
implicit-function-declaration
undef
)
endif()
generate_warning_cflags(WARNINGS_CFLAGS "${WARNINGS}" "${WARNINGS_DISABLED}" "${WARNINGS_ERRORS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNINGS_CFLAGS}")