Merge pull request #575 from atgeirr/suppress-external-warnings

Suppress external warnings
This commit is contained in:
Bård Skaflestad 2014-04-15 22:28:56 +02:00
commit 06b1611b26
2 changed files with 21 additions and 0 deletions

View File

@ -12,3 +12,20 @@ if (CXX_COMPAT_GCC)
add_options (ALL_LANGUAGES ALL_BUILDS "${_warn_flag}") add_options (ALL_LANGUAGES ALL_BUILDS "${_warn_flag}")
endif (_warn_flag) endif (_warn_flag)
endif () endif ()
option(SILENCE_DUNE_WARNINGS "Disable warnings from DUNE?" OFF)
if(SILENCE_EXTERNAL_WARNINGS AND CXX_COMPAT_GCC)
file(WRITE ${CMAKE_BINARY_DIR}/disable_warning_pragmas.h "
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored \"-Wdeprecated-declarations\"
#pragma GCC diagnostic ignored \"-Wdeprecated-register\"
#pragma GCC diagnostic ignored \"-Wignored-qualifiers\"
#pragma GCC diagnostic ignored \"-Wmismatched-tags\"
#pragma GCC diagnostic ignored \"-Wshadow\"
#pragma GCC diagnostic ignored \"-Wsign-compare\"
#pragma GCC diagnostic ignored \"-Wunused-parameter\"")
file(WRITE ${CMAKE_BINARY_DIR}/reenable_warning_pragmas.h "#pragma GCC diagnostic pop")
else()
file(WRITE ${CMAKE_BINARY_DIR}/disable_warning_pragmas.h "")
file(WRITE ${CMAKE_BINARY_DIR}/reenable_warning_pragmas.h "")
endif()

View File

@ -30,6 +30,8 @@
// the deprecated member anyway (in this compilation unit) // the deprecated member anyway (in this compilation unit)
#define DUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD 1 #define DUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD 1
#include "disable_warning_pragmas.h"
// TODO: clean up includes. // TODO: clean up includes.
#include <dune/common/deprecated.hh> #include <dune/common/deprecated.hh>
#include <dune/common/version.hh> #include <dune/common/version.hh>
@ -49,6 +51,8 @@
#include <dune/istl/paamg/fastamg.hh> #include <dune/istl/paamg/fastamg.hh>
#endif #endif
#include "reenable_warning_pragmas.h"
#include <stdexcept> #include <stdexcept>
#include <iostream> #include <iostream>
#include <type_traits> #include <type_traits>