mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
TRILAB-192 - cleanup edits and match CMake CXX to autotools
This commit is contained in:
parent
f1893e9404
commit
e68848f397
1
MANIFEST
1
MANIFEST
@ -165,6 +165,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
|
||||
|
@ -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
|
||||
# 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 ()
|
||||
|
||||
#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")
|
||||
|
||||
# # 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 ()
|
||||
|
@ -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 ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
@ -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=
|
||||
|
1
config/gnu-warnings/cxx-4.9
Normal file
1
config/gnu-warnings/cxx-4.9
Normal file
@ -0,0 +1 @@
|
||||
-Wopenmp-simd
|
Loading…
Reference in New Issue
Block a user