mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add generation and use of warning-suppressing headers.
This commit is contained in:
parent
03218f5470
commit
1e75efd097
@ -12,3 +12,20 @@ if (CXX_COMPAT_GCC)
|
||||
add_options (ALL_LANGUAGES ALL_BUILDS "${_warn_flag}")
|
||||
endif (_warn_flag)
|
||||
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()
|
||||
|
@ -25,11 +25,17 @@
|
||||
|
||||
#include <dune/common/version.hh>
|
||||
|
||||
#include "disable_warning_pragmas.h"
|
||||
|
||||
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
|
||||
#include <dune/common/parallel/mpihelper.hh>
|
||||
#else
|
||||
#include <dune/common/mpihelper.hh>
|
||||
#endif
|
||||
#include <dune/grid/CpGrid.hpp>
|
||||
#include <dune/grid/common/GridAdapter.hpp>
|
||||
|
||||
#include "reenable_warning_pragmas.h"
|
||||
|
||||
#include <opm/core/pressure/FlowBCManager.hpp>
|
||||
|
||||
@ -38,9 +44,6 @@
|
||||
|
||||
#include <opm/core/grid/GridManager.hpp>
|
||||
|
||||
#include <dune/grid/CpGrid.hpp>
|
||||
#include <dune/grid/common/GridAdapter.hpp>
|
||||
|
||||
#include <opm/core/wells.h>
|
||||
#include <opm/core/wells/WellsManager.hpp>
|
||||
#include <opm/core/utility/ErrorMacros.hpp>
|
||||
|
@ -20,8 +20,13 @@
|
||||
#ifndef OPM_AUTODIFFBLOCK_HEADER_INCLUDED
|
||||
#define OPM_AUTODIFFBLOCK_HEADER_INCLUDED
|
||||
|
||||
#include "disable_warning_pragmas.h"
|
||||
|
||||
#include <Eigen/Eigen>
|
||||
#include <Eigen/Sparse>
|
||||
|
||||
#include "reenable_warning_pragmas.h"
|
||||
|
||||
#include <vector>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -34,7 +34,9 @@
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#ifdef HAVE_DUNE_CORNERPOINT
|
||||
#include "disable_warning_pragmas.h"
|
||||
#include <dune/grid/CpGrid.hpp>
|
||||
#include "reenable_warning_pragmas.h"
|
||||
#endif
|
||||
|
||||
namespace Opm
|
||||
|
@ -24,8 +24,14 @@
|
||||
#include <opm/autodiff/GridHelpers.hpp>
|
||||
//#include <opm/core/pressure/tpfa/trans_tpfa.h>
|
||||
#include <opm/core/pressure/tpfa/TransTpfa.hpp>
|
||||
|
||||
#include "disable_warning_pragmas.h"
|
||||
|
||||
#include <Eigen/Eigen>
|
||||
|
||||
#include "reenable_warning_pragmas.h"
|
||||
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
|
@ -25,6 +25,9 @@
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
#include <opm/core/grid.h>
|
||||
#include <opm/core/grid/GridHelpers.hpp>
|
||||
|
||||
#include "disable_warning_pragmas.h"
|
||||
|
||||
#include <Eigen/Eigen>
|
||||
#include <Eigen/Sparse>
|
||||
|
||||
@ -32,6 +35,9 @@
|
||||
#include <dune/grid/CpGrid.hpp>
|
||||
#endif
|
||||
|
||||
#include "reenable_warning_pragmas.h"
|
||||
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#ifdef HAVE_DUNE_CORNERPOINT
|
||||
#include "disable_warning_pragmas.h"
|
||||
#include <dune/grid/io/file/vtk/vtkwriter.hh>
|
||||
#include "reenable_warning_pragmas.h"
|
||||
#endif
|
||||
namespace Opm
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user