Commit cc1444f6 authored by Niels Dekker's avatar Niels Dekker

COMP: A fix for MSVC warning D9025: overriding '/W1' with '/w'

Replacing '/w' and '-w' by '/W0', as discussed at http://public.kitware.com/pipermail/vtkusers/2015-September/092255.html
Cory Quammen asked me to contribute this patch.
parent 847edfb1
......@@ -376,7 +376,8 @@ function(vtk_module_warnings_disable)
foreach(lang IN LISTS ARGN)
if(MSVC)
string(REGEX REPLACE "(^| )[/-]W[0-4]( |$)" " "
CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -w")
CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}")
set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} /W0")
elseif(BORLAND)
set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -w-")
else()
......
#-----------------------------------------------------------------------------
MACRO(VTK_THIRD_PARTY_WARNING_SUPPRESS upper lang)
IF(NOT ${upper}_WARNINGS_ALLOW)
# MSVC uses /w to suppress warnings. It also complains if another
# warning level is given, so remove it.
# Visual Studio generators of CMake use /W0 to suppress warnings.
# MSVC complains if another warning level is given, so remove it.
IF(MSVC)
SET(${upper}_WARNINGS_BLOCKED 1)
STRING(REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " "
CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}")
SET(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} /w")
SET(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} /W0")
ENDIF()
# Borland uses -w- to suppress warnings.
......
......@@ -20,13 +20,13 @@ OPTION (EXODUSII_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" ON)
MARK_AS_ADVANCED(EXODUSII_DISABLE_COMPILER_WARNINGS)
IF (EXODUSII_DISABLE_COMPILER_WARNINGS)
# MSVC uses /w to suppress warnings. It also complains if another
# warning level is given, so remove it.
# Visual Studio generators of CMake use /W0 to suppress warnings.
# MSVC complains if another warning level is given, so remove it.
IF (MSVC)
SET (EXODUSII_WARNINGS_BLOCKED 1)
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " "
CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w")
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0")
ENDIF ()
IF(WIN32)
ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS)
......
......@@ -445,14 +445,14 @@ endif (HDF5_ENABLE_EMBEDDED_LIBINFO)
#-----------------------------------------------------------------------------
option (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF)
if (HDF5_DISABLE_COMPILER_WARNINGS)
# MSVC uses /w to suppress warnings. It also complains if another
# warning level is given, so remove it.
# Visual Studio generators of CMake use /W0 to suppress warnings.
# MSVC complains if another warning level is given, so remove it.
if (MSVC)
set (HDF5_WARNINGS_BLOCKED 1)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0")
endif (MSVC)
if (WIN32)
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
......
......@@ -270,15 +270,15 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/ncconfig.h.in
OPTION (NETCDF_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" ON)
MARK_AS_ADVANCED(NETCDF_DISABLE_COMPILER_WARNINGS)
IF (NETCDF_DISABLE_COMPILER_WARNINGS)
# MSVC uses /w to suppress warnings. It also complains if another
# warning level is given, so remove it.
# Visual Studio generators of CMake use /W0 to suppress warnings.
# MSVC complains if another warning level is given, so remove it.
IF (MSVC)
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " "
CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " "
CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0")
# Borland uses -w- to suppress warnings.
ELSEIF (BORLAND)
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-")
......
......@@ -55,13 +55,13 @@ ENDMACRO()
#-----------------------------------------------------------------------------
MACRO(VTK_THIRD_PARTY_WARNING_SUPPRESS upper lang)
IF(NOT ${upper}_WARNINGS_ALLOW)
# MSVC uses /w to suppress warnings. It also complains if another
# warning level is given, so remove it.
# Visual Studio generators of CMake use /W0 to suppress warnings.
# MSVC complains if another warning level is given, so remove it.
IF(MSVC)
SET(${upper}_WARNINGS_BLOCKED 1)
STRING(REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " "
CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}")
SET(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} /w")
SET(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} /W0")
ENDIF()
# Borland uses -w- to suppress warnings.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment