summaryrefslogtreecommitdiffstats
path: root/config/cmake
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-03-18 04:22:01 (GMT)
committerGitHub <noreply@github.com>2023-03-18 04:22:01 (GMT)
commit6b8249accb398eaeb9036610c214f4c70e542194 (patch)
tree44c1fc9827d61a94c4b050322bf582194718e21a /config/cmake
parent7c5d0a3756032a3f5f2cbbdf56b8824177584223 (diff)
downloadhdf5-6b8249accb398eaeb9036610c214f4c70e542194.zip
hdf5-6b8249accb398eaeb9036610c214f4c70e542194.tar.gz
hdf5-6b8249accb398eaeb9036610c214f4c70e542194.tar.bz2
Align compiler flags with develop (#2586)
Brings many compiler flag changes over from develop. Does NOT bring over -Werror changes. Also turns on Fortran silent rules, as in develop.
Diffstat (limited to 'config/cmake')
-rw-r--r--config/cmake/HDFCompilerFlags.cmake10
-rw-r--r--config/cmake/HDFFortranCompilerFlags.cmake16
2 files changed, 21 insertions, 5 deletions
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 15b158d..a9b1a42 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -267,6 +267,16 @@ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
# ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-10")
endif ()
endif ()
+
+ # Append more extra warning flags that only gcc 12.x+ knows about
+ # or which should only be enabled for gcc 12.x+
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.0)
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-12")
+ #else ()
+ # ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-12")
+ endif ()
+ endif ()
endif ()
#-----------------------------------------------------------------------------
diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake
index 599ec30..838211f 100644
--- a/config/cmake/HDFFortranCompilerFlags.cmake
+++ b/config/cmake/HDFFortranCompilerFlags.cmake
@@ -54,10 +54,6 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERS
endif ()
endif ()
-#-----------------------------------------------------------------------------
-# CDash is configured to only allow 3000 warnings, so
-# break into groups (from the config/gnu-flags file)
-#-----------------------------------------------------------------------------
if (NOT MSVC AND NOT MINGW)
# General flags
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
@@ -65,6 +61,11 @@ if (NOT MSVC AND NOT MINGW)
list (APPEND HDF5_CMAKE_Fortran_FLAGS "-stand:f03" "-free")
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-general")
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-developer-general")
+ else ()
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-no-developer-general")
+ endif ()
list (APPEND HDF5_CMAKE_Fortran_FLAGS "-ffree-form" "-fimplicit-none")
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0 AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.6)
list (APPEND HDF5_CMAKE_Fortran_FLAGS "-std=f2008ts")
@@ -82,6 +83,11 @@ if (NOT MSVC AND NOT MINGW)
# Append more extra warning flags that only gcc 4.8+ knows about
if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.8)
ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.8")
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-developer-4.8")
+ else ()
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-no-developer-4.8")
+ endif ()
endif ()
# Append more extra warning flags that only gcc 4.9+ knows about
@@ -92,7 +98,7 @@ if (NOT MSVC AND NOT MINGW)
# Append more extra warning flags that only gcc 5.x+ knows about
if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0)
if (HDF5_ENABLE_DEV_WARNINGS)
- ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-gfort-5")
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-developer-5")
endif ()
endif ()