summaryrefslogtreecommitdiffstats
path: root/config/cmake
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-07-18 11:27:07 (GMT)
committerGitHub <noreply@github.com>2023-07-18 11:27:07 (GMT)
commitaab497a6312a9d8434a7dc7b5a593713fc8fbce0 (patch)
tree018a95afb94dd103dcbef98e4a383382a52968bf /config/cmake
parent919ce7adc2f24414b749c2a6880da00259350881 (diff)
downloadhdf5-aab497a6312a9d8434a7dc7b5a593713fc8fbce0.zip
hdf5-aab497a6312a9d8434a7dc7b5a593713fc8fbce0.tar.gz
hdf5-aab497a6312a9d8434a7dc7b5a593713fc8fbce0.tar.bz2
Fix some warnings in developer builds (#3247)
* Fix some warnings in developer builds * Switch approach to Winline flag
Diffstat (limited to 'config/cmake')
-rw-r--r--config/cmake/HDFCompilerFlags.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 00850d3..1878b9b 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -189,6 +189,19 @@ if (HDF5_ENABLE_DEV_WARNINGS)
elseif (CMAKE_C_COMPILER_ID MATCHES "IntelLLVM" OR CMAKE_C_COMPILER_ID MATCHES "[Cc]lang")
ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
endif ()
+
+ # Turn on -Winline warnings now only for non-Debug and
+ # non-Developer builds. For at least GNU compilers this
+ # flag appears to conflict specifically with the -Og
+ # optimization flag and will produce warnings about functions
+ # not being considered for inlining
+ if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer")
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ list (APPEND H5_CFLAGS "-Winline")
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS)
+ list (APPEND H5_CFLAGS "-Winline")
+ endif ()
+ endif ()
else ()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")