summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2021-02-08 23:23:09 (GMT)
committerGitHub <noreply@github.com>2021-02-08 23:23:09 (GMT)
commitbccf5b5c0864896a077f5d6ef43ec1410151e693 (patch)
tree3b56a298a33ebb410f88913ef0be3d652890c953 /config
parentaa95b70f6da1852f136e36954814be0fa4b02fa2 (diff)
downloadhdf5-bccf5b5c0864896a077f5d6ef43ec1410151e693.zip
hdf5-bccf5b5c0864896a077f5d6ef43ec1410151e693.tar.gz
hdf5-bccf5b5c0864896a077f5d6ef43ec1410151e693.tar.bz2
Add option to control gcc 10 warnings diagnostics (#321)
* OESS-98 convert plugin option to FetchContent, add tests * Fixes for pkcfg files because of plugin option * OESS-98 fix tools test for plugins * Keep doxygen comments under 100 chars long - format hint * Whitespace * HDFFV-11144 - Reclassify CMake messages * HDFFV-11099/11100 added help text * Reworked switch statement to compare string instead * Fix typo * Update CDash mode * Correct name of threadsafe * Correct option name * Undo accidental commit * Note LLVM 10 to 11 format default changes * Update format plugin * Undo clang-format version 11 changes * One more correction * Update supported platforms * Revert whitespace changes * Correct whitespace * Changes from PR#3 * HDFFV-11213 added option to control gcc10 warnings diagnostics
Diffstat (limited to 'config')
-rw-r--r--config/cmake/HDFCXXCompilerFlags.cmake8
-rw-r--r--config/cmake/HDFCompilerFlags.cmake14
-rw-r--r--config/cmake/HDFFortranCompilerFlags.cmake8
-rw-r--r--config/gnu-cxxflags9
-rw-r--r--config/gnu-fflags9
-rw-r--r--config/gnu-flags9
6 files changed, 57 insertions, 0 deletions
diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake
index 4f2eabe..ebda39f 100644
--- a/config/cmake/HDFCXXCompilerFlags.cmake
+++ b/config/cmake/HDFCXXCompilerFlags.cmake
@@ -30,6 +30,14 @@ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt")
endif ()
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
+ if (HDF5_ENABLE_BUILD_DIAGS)
+ message (STATUS "... default color and URL extended diagnostic messages enabled")
+ else ()
+ message (STATUS "... disable color and URL extended diagnostic messages")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color")
+ endif ()
+ endif ()
endif ()
endif ()
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index fb527d5..3d3cc6a 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -31,6 +31,20 @@ if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt")
endif ()
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0)
+ #-----------------------------------------------------------------------------
+ # Option to allow the user to enable build extended diagnostics
+ #
+ # This should NOT be on by default as it can cause process issues.
+ #-----------------------------------------------------------------------------
+ option (HDF5_ENABLE_BUILD_DIAGS "Enable color and URL extended diagnostic messages" OFF)
+ if (HDF5_ENABLE_BUILD_DIAGS)
+ message (STATUS "... default color and URL extended diagnostic messages enabled")
+ else ()
+ message (STATUS "... disable color and URL extended diagnostic messages")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color")
+ endif ()
+ endif ()
endif ()
endif ()
diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake
index c7f085c..5521f6d 100644
--- a/config/cmake/HDFFortranCompilerFlags.cmake
+++ b/config/cmake/HDFFortranCompilerFlags.cmake
@@ -45,6 +45,14 @@ endif ()
#-----------------------------------------------------------------------------
# HDF5 library compile options
#-----------------------------------------------------------------------------
+if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 10.0)
+ if (HDF5_ENABLE_BUILD_DIAGS)
+ message (STATUS "... default color and URL extended diagnostic messages enabled")
+ else ()
+ message (STATUS "... disable color and URL extended diagnostic messages")
+ set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color")
+ endif ()
+endif ()
#-----------------------------------------------------------------------------
# CDash is configured to only allow 3000 warnings, so
diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags
index 0b48bdf..6189db6 100644
--- a/config/gnu-cxxflags
+++ b/config/gnu-cxxflags
@@ -144,6 +144,15 @@ if test "X-g++" = "X-$cxx_vendor"; then
DEBUG_CXXFLAGS="-ftrapv -fno-common"
fi
+ ########################
+ # Enhanced Diagnostics #
+ ########################
+
+ if test $cc_vers_major -ge 10; then
+ NO_DIAGS_CXXFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color"
+ fi
+ DIAGS_CXXFLAGS=
+
###########
# Symbols #
###########
diff --git a/config/gnu-fflags b/config/gnu-fflags
index 105a990..32e5a28 100644
--- a/config/gnu-fflags
+++ b/config/gnu-fflags
@@ -105,6 +105,15 @@ if test "X-gfortran" = "X-$f9x_vendor"; then
DEBUG_FCFLAGS="-fbounds-check"
fi
+ ########################
+ # Enhanced Diagnostics #
+ ########################
+
+ if test $cc_vers_major -ge 10; then
+ NO_DIAGS_FCFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color"
+ fi
+ DIAGS_FCFLAGS=
+
###########
# Symbols #
###########
diff --git a/config/gnu-flags b/config/gnu-flags
index 538fd53..6f7aea6 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -158,6 +158,15 @@ if test "X-gcc" = "X-$cc_vendor"; then
DEBUG_CFLAGS="-ftrapv -fno-common"
fi
+ ########################
+ # Enhanced Diagnostics #
+ ########################
+
+ if test $cc_vers_major -ge 10; then
+ NO_DIAGS_CFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color"
+ fi
+ DIAGS_CFLAGS=
+
###########
# Symbols #
###########