summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-04-13 13:43:10 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-04-13 13:43:10 (GMT)
commitaac7605be02aa7be10e7681c1f7af03b11e7ddc2 (patch)
treebefa5b0e76bfb6c3c73e752523d2a2e6e7ffd715
parent142496ad74187290c2b5ab273ec2ebfdfeaa68b5 (diff)
downloadhdf5-aac7605be02aa7be10e7681c1f7af03b11e7ddc2.zip
hdf5-aac7605be02aa7be10e7681c1f7af03b11e7ddc2.tar.gz
hdf5-aac7605be02aa7be10e7681c1f7af03b11e7ddc2.tar.bz2
TRILAB-192 - cleanup edits and match CMake CXX to autotools
-rw-r--r--MANIFEST1
-rw-r--r--config/cmake/HDFCXXCompilerFlags.cmake189
-rw-r--r--config/cmake/HDFCompilerFlags.cmake90
-rw-r--r--config/gnu-cxxflags7
-rw-r--r--config/gnu-warnings/cxx-4.91
5 files changed, 200 insertions, 88 deletions
diff --git a/MANIFEST b/MANIFEST
index 0e1a2d8..97e5277 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -164,6 +164,7 @@
./config/gnu-warnings/8
./config/gnu-warnings/9
./config/gnu-warnings/cxx-general
+./config/gnu-warnings/cxx-4.9
./config/gnu-warnings/developer-4.5
./config/gnu-warnings/developer-4.6
./config/gnu-warnings/developer-4.7
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 75ba7c9..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,12 +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