gcc: [skip ci] suppress gcc 10 warnings in smesh code

This commit is contained in:
wmayer
2020-06-08 11:40:16 +02:00
parent 08121cf709
commit 2a9e236bfc

View File

@@ -6,26 +6,11 @@ SET(SMESH_VERSION_MINOR 7)
SET(SMESH_VERSION_PATCH 1)
SET(SMESH_VERSION_TWEAK 0)
# Suppress gcc warnings
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-sign-compare -Wno-reorder -Wno-switch -Wno-unused-variable -Wno-unused-but-set-variable -Wno-comment -Wno-unused-parameter -Wno-empty-body -Wno-pedantic")
elseif(CMAKE_COMPILER_IS_CLANGXX)
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-self-assign -Wno-sign-compare -Wno-logical-op-parentheses -Wno-reorder -Wno-switch -Wno-switch-enum -Wno-unknown-pragmas -Wno-unused-variable -Wno-unused-private-field")
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-unused-function -Wno-sometimes-uninitialized -Wno-overloaded-virtual -Wno-dynamic-class-memaccess -Wno-comment -Wno-unused-parameter -Wno-extra-semi")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable -Wno-unused-but-set-variable")
if(CMAKE_COMPILER_IS_CLANGXX)
unset(_flag_found CACHE)
check_cxx_compiler_flag("-Wno-deprecated-copy" _flag_found)
if (_flag_found)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy")
endif ()
unset(_flag_found CACHE)
check_cxx_compiler_flag("-Wno-missing-field-initializers" _flag_found)
if (_flag_found)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
endif ()
elseif(CMAKE_COMPILER_IS_GNUCXX)
unset(_flag_found CACHE)
check_cxx_compiler_flag("-Wno-unused-result" _flag_found)
if (_flag_found)
@@ -39,6 +24,23 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized")
endif ()
unset(_flag_found CACHE)
check_cxx_compiler_flag("-Wno-missing-field-initializers" _flag_found)
if (_flag_found)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
endif ()
# Suppress clang warnings
elseif(CMAKE_COMPILER_IS_CLANGXX)
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-self-assign -Wno-sign-compare -Wno-logical-op-parentheses -Wno-reorder -Wno-switch -Wno-switch-enum -Wno-unknown-pragmas -Wno-unused-variable -Wno-unused-private-field")
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-unused-function -Wno-sometimes-uninitialized -Wno-overloaded-virtual -Wno-dynamic-class-memaccess -Wno-comment -Wno-unused-parameter -Wno-extra-semi")
unset(_flag_found CACHE)
check_cxx_compiler_flag("-Wno-deprecated-copy" _flag_found)
if (_flag_found)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy")
endif ()
unset(_flag_found CACHE)
check_cxx_compiler_flag("-Wno-missing-field-initializers" _flag_found)
if (_flag_found)
@@ -46,6 +48,7 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
endif ()
endif()
if (VTK_OPTIONS)
add_definitions(${VTK_OPTIONS})
endif()