build: enable more warnings for gcc
Enable implicit-function-declaration and redundant-decls warnings when compiling with gcc. redundant-decl useful for exported headers.
This commit is contained in:
parent
b33bba0428
commit
02e6c3932b
@ -175,6 +175,14 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format")
|
||||
endif()
|
||||
endif()
|
||||
CHECK_C_COMPILER_FLAG (-Wimplicit-function-declaration Wimplicit-function-declaration)
|
||||
if(Wimplicit-function-declaration)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wimplicit-function-declaration")
|
||||
endif()
|
||||
CHECK_C_COMPILER_FLAG (-Wredundant-decls Wredundant-decls)
|
||||
if(Wredundant-decls)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wredundant-decls")
|
||||
endif()
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG")
|
||||
|
Loading…
Reference in New Issue
Block a user