From 866e02935deb28373130116dac578d84e057a03e Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Tue, 18 Jul 2017 18:46:53 +0200 Subject: 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 --- tests/server/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/server/CMakeLists.txt b/tests/server/CMakeLists.txt index e456a94df..cfc1434cd 100644 --- a/tests/server/CMakeLists.txt +++ b/tests/server/CMakeLists.txt @@ -1,5 +1,9 @@ set(TARGET_LABEL_PREFIX "Test server ") +if(MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4127 /wd4306") +endif() + function(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test add_executable( ${TEST_NAME} ${ARGN} ) string(TOUPPER ${TEST_NAME} UPPER_TEST_NAME) -- cgit v1.2.3