summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-04-13 13:16:57 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-04-13 13:16:57 (GMT)
commite68848f397eb66ffbec86ab59b7754c48281e0b3 (patch)
treef1817a362c955b5b99b4d609ab46350b65cc3a9c /config
parentf1893e940426dce5885c2d04932af24921cf4f4a (diff)
downloadhdf5-e68848f397eb66ffbec86ab59b7754c48281e0b3.zip
hdf5-e68848f397eb66ffbec86ab59b7754c48281e0b3.tar.gz
hdf5-e68848f397eb66ffbec86ab59b7754c48281e0b3.tar.bz2
TRILAB-192 - cleanup edits and match CMake CXX to autotools
Diffstat (limited to 'config')
-rw-r--r--config/cmake/HDFCXXCompilerFlags.cmake189
-rw-r--r--config/cmake/HDFCompilerFlags.cmake90
-rw-r--r--config/gnu-cxxflags8
-rw-r--r--config/gnu-warnings/cxx-4.91
4 files changed, 199 insertions, 89 deletions
diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake
index bf22886..6aa8784 100644
--- a/config/cmake/HDFCXXCompilerFlags.cmake
+++ b/config/cmake/HDFCXXCompilerFlags.cmake
@@ -104,6 +104,8 @@ if (NOT MSVC)
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general")
ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general")
endif ()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
@@ -114,47 +116,160 @@ if (NOT MSVC)
message (STATUS "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}")
endif ()
- #-----------------------------------------------------------------------------
- # Option to allow the user to enable developer warnings
- # Developer warnings (suggestions from gcc, not code problems)
- #-----------------------------------------------------------------------------
- #if (HDF5_ENABLE_DEV_WARNINGS)
- # message (STATUS "....HDF5 developer group warnings are enabled")
- # if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- # list (APPEND H5_CXXFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing")
- # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
- # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
- # endif ()
- #else ()
- # if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
- # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
- # endif ()
- #endif ()
-
+ #-----------------------------------------------------------------------------
+ # Option to allow the user to enable developer warnings
+ # Developer warnings (suggestions from gcc, not code problems)
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ message (STATUS "....HDF5 developer group warnings are enabled")
+ # if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ # list (APPEND H5_CXXFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing")
+ # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
+ # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
+ endif ()
+ else ()
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
+ # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
+ endif ()
+ endif ()
- #if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- # # Append warning flags that only gcc 4.3+ knows about
- # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3")
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ # Append warning flags that only gcc 4.3+ knows about
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3")
+ #
+ # Technically, variable-length arrays are part of the C99 standard, but
+ # we should approach them a bit cautiously... Only needed for gcc 4.X
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last")
+ endif ()
- # # Append more extra warning flags that only gcc 4.4+ know about
- # if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
- # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4")
- # endif ()
- #endif ()
+ # Append more extra warning flags that only gcc 4.4+ know about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4")
+ endif ()
# Append more extra warning flags that only gcc 4.5+ know about
- #if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5)
- # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5")
- # if (HDF5_ENABLE_DEV_WARNINGS)
- # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5")
- # else ()
- # ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.5")
- # endif ()
- #endif ()
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5")
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5")
+ else ()
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.5")
+ endif ()
+ endif ()
+
+ # Append more extra warning flags that only gcc 4.6 and less know about
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.6")
+ endif ()
+
+ # Append more extra warning flags that only gcc 4.5-4.6 know about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5-4.6")
+ endif ()
+
+ # Append more extra warning flags that only gcc 4.6+ know about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.6")
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.6")
+ else ()
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.6")
+ endif ()
+ endif ()
+
+ # Append more extra warning flags that only gcc 4.7+ know about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.7")
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.7")
+ else ()
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.7")
+ endif ()
+ endif ()
+
+ # Append more extra warning flags that only gcc 4.8+ know about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8")
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8")
+ else ()
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8")
+ endif ()
+ endif ()
+
+ # Append more extra warning flags that only gcc 4.9+ know about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9")
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.9")
+ endif ()
+
+ # Append more extra warning flags that only gcc 5.1+ know about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/5")
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
+ endif ()
+
+ # Append more extra warning flags that only gcc 6.x+ know about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/6")
+ endif ()
+
+ # Append more extra warning flags that only gcc 7.x+ know about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXxFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/7")
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7")
+ #else ()
+ # ADD_H5_FLAGS (H5_CXXFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7")
+ endif ()
+ endif ()
+
+ # Append more extra warning flags that only gcc 8.x+ know about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/8")
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8")
+ else ()
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8")
+ endif ()
+ endif ()
+
+ # Append more extra warning flags that only gcc 9.x+ know about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS4 "${HDF5_SOURCE_DIR}/config/gnu-warnings/9")
+ endif ()
+ endif ()
else ()
list (APPEND HDF5_CMAKE_CXX_FLAGS "/EHsc")
endif ()
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index b255e22..72141c0 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -125,47 +125,46 @@ if (NOT MSVC)
message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}")
endif ()
- #-----------------------------------------------------------------------------
- # Option to allow the user to enable developer warnings
- # Developer warnings (suggestions from gcc, not code problems)
- #-----------------------------------------------------------------------------
- option (HDF5_ENABLE_DEV_WARNINGS "Enable HDF5 developer group warnings" OFF)
- if (HDF5_ENABLE_DEV_WARNINGS)
- message (STATUS "....HDF5 developer group warnings are enabled")
- if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
- list (APPEND H5_CFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing")
- elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
- elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
- endif ()
- else ()
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
- elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
- endif ()
+ #-----------------------------------------------------------------------------
+ # Option to allow the user to enable developer warnings
+ # Developer warnings (suggestions from gcc, not code problems)
+ #-----------------------------------------------------------------------------
+ option (HDF5_ENABLE_DEV_WARNINGS "Enable HDF5 developer group warnings" OFF)
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ message (STATUS "....HDF5 developer group warnings are enabled")
+ if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ list (APPEND H5_CFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing")
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
+ endif ()
+ else ()
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
endif ()
+ endif ()
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
- # Append warning flags that only gcc 4.3+ knows about
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3")
- #
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... Only needed for gcc 4.X
- if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last")
- endif ()
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ # Append warning flags that only gcc 4.3+ knows about
+ ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3")
+ #
+ # Technically, variable-length arrays are part of the C99 standard, but
+ # we should approach them a bit cautiously... Only needed for gcc 4.X
+ if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
+ ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.last")
+ endif ()
- # Append more extra warning flags that only gcc 4.4+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4")
- endif ()
+ # Append more extra warning flags that only gcc 4.4+ know about
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
+ ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.4")
endif ()
# Append more extra warning flags that only gcc 4.5+ know about
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5")
if (HDF5_ENABLE_DEV_WARNINGS)
ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.5")
@@ -175,17 +174,17 @@ if (NOT MSVC)
endif ()
# Append more extra warning flags that only gcc 4.6 and less know about
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
+ if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.2-4.6")
endif ()
# Append more extra warning flags that only gcc 4.5-4.6 know about
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.5-4.6")
endif ()
# Append more extra warning flags that only gcc 4.6+ know about
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.6")
if (HDF5_ENABLE_DEV_WARNINGS)
ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.6")
@@ -195,7 +194,7 @@ if (NOT MSVC)
endif ()
# Append more extra warning flags that only gcc 4.7+ know about
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.7")
if (HDF5_ENABLE_DEV_WARNINGS)
ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.7")
@@ -205,7 +204,7 @@ if (NOT MSVC)
endif ()
# Append more extra warning flags that only gcc 4.8+ know about
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8")
if (HDF5_ENABLE_DEV_WARNINGS)
ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8")
@@ -215,23 +214,23 @@ if (NOT MSVC)
endif ()
# Append more extra warning flags that only gcc 4.9+ know about
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9)
ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9")
endif ()
# Append more extra warning flags that only gcc 5.1+ know about
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/5")
ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
endif ()
# Append more extra warning flags that only gcc 6.x+ know about
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0)
ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/6")
endif ()
# Append more extra warning flags that only gcc 7.x+ know about
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0)
ADD_H5_FLAGS (H5_CFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/7")
if (HDF5_ENABLE_DEV_WARNINGS)
ADD_H5_FLAGS (H5_CFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7")
@@ -241,7 +240,7 @@ if (NOT MSVC)
endif ()
# Append more extra warning flags that only gcc 8.x+ know about
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0)
ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/8")
if (HDF5_ENABLE_DEV_WARNINGS)
ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8")
@@ -251,9 +250,10 @@ if (NOT MSVC)
endif ()
# Append more extra warning flags that only gcc 9.x+ know about
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0)
ADD_H5_FLAGS (H5_CFLAGS4 "${HDF5_SOURCE_DIR}/config/gnu-warnings/9")
endif ()
+ endif ()
endif ()
#-----------------------------------------------------------------------------
diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags
index 03231d2..e177aef 100644
--- a/config/gnu-cxxflags
+++ b/config/gnu-cxxflags
@@ -266,6 +266,7 @@ if test "X-g++" = "X-$cxx_vendor"; then
# gcc >= 4.9
if test $cc_vers_major -ge 5 -o $cc_vers_major -eq 4 -a $cc_vers_minor -ge 9; then
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.9)"
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-4.9)"
fi
# gcc >= 5
@@ -304,13 +305,6 @@ if test "X-g++" = "X-$cxx_vendor"; then
cxx_flags_set=yes
fi
-# Version-specific g++ flags
-
-# This flag was left behind when moving warnings flags to common files for
-# both autotools and CMake.
-# # Append more extra warning flags that only gcc 4.9+ know about
-# -Wopenmp-simd"
-
# Clear cxx info if no flags set
if test "X$cxx_flags_set" = "X"; then
cxx_vendor=
diff --git a/config/gnu-warnings/cxx-4.9 b/config/gnu-warnings/cxx-4.9
new file mode 100644
index 0000000..046d6db
--- /dev/null
+++ b/config/gnu-warnings/cxx-4.9
@@ -0,0 +1 @@
+-Wopenmp-simd