switch to default /W4 for msvc

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16116 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2006-11-29 22:36:43 +00:00
parent 9feb262948
commit a73732e0ec
3 changed files with 50 additions and 2 deletions

View File

@ -118,6 +118,46 @@ else(MSVC AND NOT disable-pch)
endmacro(lyx_add_msvc_pch)
endif(MSVC AND NOT disable-pch)
if(MSVC)
if(WALL)
set(DISABLEWALL 0 CACHE TYPE STRING FORCE)
endif(WALL)
if(NOT DISABLEWALL)
# Use the highest warning level
set(CMAKE_CXX_WARNING_LEVEL 4 CACHE TYPE STRING FORCE)
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
STRING(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
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]")
# add here warings which should produce an error /weXXXX
SET(MSVC_W_ERROR " ")
# add here warings 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}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}")
else(NOT DISABLEWALL)
set(DISABLEWALL 1 CACHE TYPE STRING FORCE)
set(CMAKE_CXX_WARNING_LEVEL 3 CACHE TYPE STRING FORCE)
endif(NOT DISABLEWALL)
endif(MSVC)
#TODO: insource is not the best place
configure_file(${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py.in

View File

@ -19,6 +19,16 @@ Building Visual C++ 2005 project files:
- create a build directory, e.g. .../trunk/../build
- call in the build directory 'cmake ..\trunk\development\cmake'
- start lyx.sln
- Warnings:
The default warning level of the msvc cmake builds is now /W4.
The cmake option
-DDISABLEWALL=1
switches to /W3,
-DWALL=1
re enables /W4.
To disable a specific warning add it to MSVC_W_DISABLE of
cmake/CMakeLists.txt. To make the warning an error add it
to MSVC_W_ERROR of the same file.
TIPS: - rename Microsoft Visual Studio 8\VC\vcpackages\feacp.dll
to disable Intellisense

View File

@ -170,8 +170,6 @@
#endif
#ifdef _MSC_VER
#pragma warning( disable : 4800 ) //: forcing value to bool 'true' or 'false' (performance warning)
#pragma warning( disable : 4996 ) //: was declared deprecated
#ifdef HAVE_CHMOD
#undef HAVE_CHMOD
#endif