diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2020-05-18 19:28:51 (GMT) |
---|---|---|
committer | Larry Knox <lrknox@hdfgroup.org> | 2020-05-19 02:33:13 (GMT) |
commit | 22b61f470acc54afad5705dea23a7a8423e65cff (patch) | |
tree | a8d6d4be22e69b92f7e51a00711578de13614255 /config/cmake/HDFCXXCompilerFlags.cmake | |
parent | 0d88516c2eafcd4ca538442afe21caf4ff1aeb1f (diff) | |
download | hdf5-22b61f470acc54afad5705dea23a7a8423e65cff.zip hdf5-22b61f470acc54afad5705dea23a7a8423e65cff.tar.gz hdf5-22b61f470acc54afad5705dea23a7a8423e65cff.tar.bz2 |
Revise gnu-*flags and cmake/HDF*CompilerFlags.cmake files to add warning
flags for GCC compilers version 4.8 and above.
Removed files from gnu-warnings that only apply to versions < 4.8.
Consolidated warnings from versions < 4.8 that apply to versions >= 4.8
into the 4.8 warnings files.
Diffstat (limited to 'config/cmake/HDFCXXCompilerFlags.cmake')
-rw-r--r-- | config/cmake/HDFCXXCompilerFlags.cmake | 71 |
1 files changed, 4 insertions, 67 deletions
diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index 47991bf..02bf5cd 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -86,9 +86,8 @@ if (NOT MSVC) endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED - AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) - # autotools adds the C flags with the CXX flags for g++ compiler - # versions 4.2 and above. + AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) + # add the general CXX flags for g++ compiler versions 4.8 and above. ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general") ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general") endif () @@ -127,71 +126,9 @@ if (NOT MSVC) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # 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 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) # 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 warning flags that only gcc 4.3+ knows about - # autotools always add the C flags with the CXX flags - if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.3") - 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 (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 AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2) - # 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 () + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last") endif () # Append more extra warning flags that only gcc 4.8+ know about |