From 76f03118c440a4d92e79274083272610fbccc259 Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Thu, 28 Nov 2013 17:20:04 +0100
Subject: [PATCH] Only compile with -Wmissing-declarations and
-Wmissing-prototypes in library, not tests and programs
---
CMakeLists.txt | 6 +++---
library/CMakeLists.txt | 5 +++++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 422a7c4cf..7b9099356 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,10 +7,10 @@ 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")
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_SHARED_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index c4060d1a5..1a3e0772f 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -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})