summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2017-07-18 18:46:53 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2017-08-03 08:39:23 +0200
commit866e02935deb28373130116dac578d84e057a03e (patch)
tree037c9675884a4fd631c2d1df58161b3deedc2d6c /CMakeLists.txt
parent70934885d0ed23c83a01efc70034f811d20a33e6 (diff)
downloadcurl-866e02935deb28373130116dac578d84e057a03e.tar.gz
CMake: set MSVC warning level to 4
The MSVC warning level defaults to 3 in CMake. Change it to 4, which is consistent with the Visual Studio and NMake builds. Disable level 4 warning C4127 for the library and additionally C4306 for the test servers to get a clean CURL_WERROR build as that warning is raised in some macros in older Visual Studio versions. Ref: https://github.com/curl/curl/pull/1667#issuecomment-314082794 Closes https://github.com/curl/curl/pull/1711
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f21d89e8f..171941128 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1161,6 +1161,11 @@ endif(WIN32)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
+ if(CMAKE_C_FLAGS MATCHES "/W[0-4]")
+ string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+ else(CMAKE_C_FLAGS MATCHES "/W[0-4]")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
+ endif(CMAKE_C_FLAGS MATCHES "/W[0-4]")
endif(MSVC)
# Ugly (but functional) way to include "Makefile.inc" by transforming it (= regenerate it).