From 4fe3d7d426bb02c244f2db1775e62d2ef3ac2c4d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20K=C3=BCmmel?= Date: Sat, 30 Dec 2006 13:53:34 +0000 Subject: [PATCH] also warnings as errors with /W3 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16440 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/cmake/CMakeLists.txt | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/development/cmake/CMakeLists.txt b/development/cmake/CMakeLists.txt index f0ba6498cc..855067e82c 100644 --- a/development/cmake/CMakeLists.txt +++ b/development/cmake/CMakeLists.txt @@ -152,10 +152,9 @@ if(MSVC) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") endif(CMAKE_C_FLAGS MATCHES "/W[0-4]") - # add here warings which should produce an error /weXXXX - SET(MSVC_W_ERROR " ") - - # add here warings which should be disabled /wdXXXX + # add here warnings which should produce an error /weXXXX + SET(MSVC_W_ERROR "/we4101 /we4189") + # add here warnings which should be disabled /wdXXXX SET(MSVC_W_DISABLE "/wd4800 /wd4996 /wd4311 /wd4312 /wd4505") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}") @@ -166,12 +165,24 @@ if(MSVC) set(DISABLEWALL 1 CACHE TYPE STRING FORCE) set(CMAKE_CXX_WARNING_LEVEL 3 CACHE TYPE STRING FORCE) + set(WARNING_LEVEL_MESSAGE "(switch to warning level 4 with -DWALL=1)") + + # add here warnings which should produce an error /weXXXX + SET(MSVC_W_ERROR "/we4101 /we4189") + # add here warnings which should be disabled /wdXXXX + SET(MSVC_W_DISABLE "/wd4800 /wd4996") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4800 /wd4996") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4800 /wd4996") - set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /wd4800 /wd4996") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MSVC_W_ERROR} ${MSVC_W_DISABLE}") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${MSVC_W_ERROR} ${MSVC_W_DISABLE}") + set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${MSVC_W_ERROR} ${MSVC_W_DISABLE}") endif(NOT DISABLEWALL) + + message("----- Warning level : ${CMAKE_CXX_WARNING_LEVEL} ${WARNING_LEVEL_MESSAGE}") + message("----- Warnings as errors : ${MSVC_W_ERROR}") + message("----- Warnings disabled : ${MSVC_W_DISABLE}") + message("") + endif(MSVC) -- 2.39.2