[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 42/256: cmake: enable picky compiler options with c
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 42/256: cmake: enable picky compiler options with clang and gcc |
Date: |
Fri, 06 Oct 2017 19:42:13 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit b93954261dfb45a0d4016cda2e02abdf5ba55a6c
Author: Daniel Stenberg <address@hidden>
AuthorDate: Thu Aug 17 15:55:38 2017 +0200
cmake: enable picky compiler options with clang and gcc
closes #1799
---
CMakeLists.txt | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e70afd6c8..50ff5adbf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,6 +43,7 @@ set(CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
include(Utilities)
include(Macros)
include(CMakeDependentOption)
+include(CheckCCompilerFlag)
project( CURL C )
@@ -73,6 +74,7 @@ include_directories(${PROJECT_BINARY_DIR}/include/curl)
include_directories( ${CURL_SOURCE_DIR}/include )
option(CURL_WERROR "Turn compiler warnings into errors" OFF)
+option(PICKY_COMPILER "Enable picky compiler options" ON)
option(BUILD_CURL_EXE "Set to ON to build curl executable." ON)
option(CURL_STATICLIB "Set to ON to build libcurl with static linking." OFF)
option(ENABLE_ARES "Set to ON to enable c-ares support" OFF)
@@ -88,6 +90,19 @@ CMAKE_DEPENDENT_OPTION(ENABLE_THREADED_RESOLVER "Set to ON
to enable threaded DN
option(ENABLE_DEBUG "Set to ON to enable curl debug features" OFF)
option(ENABLE_CURLDEBUG "Set to ON to build with TrackMemory feature enabled"
OFF)
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+ if (PICKY_COMPILER)
+ foreach (_CCOPT -pedantic -Wall -W -Wpointer-arith -Wwrite-strings
-Wunused -Wshadow -Winline -Wnested-externs -Wmissing-declarations
-Wmissing-prototypes -Wno-long-long -Wfloat-equal -Wno-multichar -Wsign-compare
-Wundef -Wno-format-nonliteral -Wendif-labels -Wstrict-prototypes
-Wdeclaration-after-statement -Wstrict-aliasing=3 -Wcast-align -Wtype-limits
-Wold-style-declaration -Wmissing-parameter-type -Wempty-body -Wclobbered
-Wignored-qualifiers -Wconversion -Wno-sign-conversion -W [...]
+ # surprisingly, CHECK_C_COMPILER_FLAG needs a new variable to store each
new
+ # test result in.
+ CHECK_C_COMPILER_FLAG(${_CCOPT} OPT${_CCOPT})
+ if(OPT${_CCOPT})
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_CCOPT}")
+ endif()
+ endforeach()
+ endif(PICKY_COMPILER)
+endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+
if (ENABLE_DEBUG)
# DEBUGBUILD will be defined only for Debug builds
if(NOT CMAKE_VERSION VERSION_LESS 3.0)
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 62/256: vtls: make sure all _cleanup() functions return void, (continued)
- [GNUnet-SVN] [gnurl] 62/256: vtls: make sure all _cleanup() functions return void, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 91/256: version: if built with more than one SSL backend, report all of them, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 88/256: docs/examples: demonstrate how to select SSL backends, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 61/256: vtls: use consistent signature for _random() implementations, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 92/256: vtls: use Curl_ssl_multi pseudo backend only when needed, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 83/256: vtls: fold the backend ID into the Curl_ssl structure, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 68/256: vtls: move md5sum into the Curl_ssl struct, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 45/256: tool_main: turn off MinGW CRT's globbing, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 25/256: system.h: remove all CURL_SIZEOF_* defines, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 96/256: asyn-thread: Improved cleanup after OOM situations, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 42/256: cmake: enable picky compiler options with clang and gcc,
gnunet <=
- [GNUnet-SVN] [gnurl] 76/256: vtls: move SSL backends' private constants out of their header files, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 97/256: unit1606: Fixed shadowed variable warning, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 65/256: vtls: introduce a new struct for SSL backends, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 86/256: vtls: introduce curl_global_sslset(), gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 105/256: curl.h: CURLSSLBACKEND_WOLFSSL used wrong value, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 77/256: getinfo: access SSL internals via Curl_ssl, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 87/256: Add a man page for curl_global_sslset(), gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 103/256: curl/multi.h: remove duplicated closing c++ brace, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 43/256: config-win32: define SIZEOF_LONG, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 94/256: configure: Handle "MultiSSL" specially When versioning symbols, gnunet, 2017/10/06