Only compile with -Wmissing-declarations and -Wmissing-prototypes in

library, not tests and programs
This commit is contained in:
Paul Bakker 2013-11-28 17:20:04 +01:00
parent 3ddfa663a5
commit 76f03118c4
2 changed files with 8 additions and 3 deletions

View file

@ -7,8 +7,8 @@ if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -Wall -Wextra -W -Wdeclaration-after-statement")
set(CMAKE_C_FLAGS_DEBUG "-g3 -O0")
set(CMAKE_C_FLAGS_COVERAGE "-g3 -O0 -fprofile-arcs -ftest-coverage -lgcov")
set(CMAKE_C_FLAGS_CHECK "${CMAKE_C_FLAGS} -O2 -Wall -Wextra -W -Wdeclaration-after-statement -Wlogical-op -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations")
set(CMAKE_C_FLAGS_CHECKFULL "${CMAKE_C_FLAGS} -O2 -Wall -Wextra -W -Wdeclaration-after-statement -Wlogical-op -Wcast-qual -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations")
set(CMAKE_C_FLAGS_CHECK "${CMAKE_C_FLAGS} -Wlogical-op -Wwrite-strings")
set(CMAKE_C_FLAGS_CHECKFULL "${CMAKE_C_FLAGS_CHECK} -Wcast-qual")
endif(CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_BUILD_TYPE STREQUAL "Coverage")

View file

@ -69,6 +69,11 @@ if(WIN32)
set(libs ws2_32)
endif(WIN32)
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS_CHECK "${CMAKE_C_FLAGS_CHECK} -Wmissing-declarations -Wmissing-prototypes")
set(CMAKE_C_FLAGS_CHECKFULL "${CMAKE_C_FLAGS_CHECK} -Wcast-qual")
endif(CMAKE_COMPILER_IS_GNUCC)
if(NOT USE_SHARED_POLARSSL_LIBRARY)
add_library(polarssl STATIC ${src})