Files
hdf5/config/flags/HDFClangCXXFlags.cmake
T
Allen Byrne aa9784ea25 Refactor the config/cmake folder #5446 (#5540)
* Update config/examples/HDF5AsSubdirMacros.cmake
* Move f90 config file and remove m4 dir
2025-05-22 11:20:51 -05:00

57 lines
2.5 KiB
CMake

#
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the LICENSE file, which can be found at the root of the source code
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
###############################################################################
# This file included from HDFCompilerFlags.cmake with
# if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
###############################################################################
#-----------------------------------------------------------------------------
# Compiler specific flags
#-----------------------------------------------------------------------------
if (${HDF_CFG_NAME} MATCHES "Debug" OR ${HDF_CFG_NAME} MATCHES "Developer")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common")
endif ()
if (WIN32 AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set (_CLANG_MSVC_WINDOWS 1)
endif()
#-----------------------------------------------------------------------------
# HDF5 library compile options - to be made available to all targets
#-----------------------------------------------------------------------------
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
# General flags
#
# Note that some of the flags listed here really should be developer
# flags (listed in a separate variable, below) but we put them here
# because they are not raised by the current code and we'd like to
# know if they do start showing up.
#
# NOTE: Don't add -Wpadded here since we can't/won't fix the (many)
# warnings that are emitted. If you need it, add it at configure time.
ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF_CONFIG_DIR}/clang-warnings/general")
message (VERBOSE "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 CXX developer group warnings are enabled")
ADD_H5_FLAGS (H5_CXXFLAGS "${HDF_CONFIG_DIR}/clang-warnings/developer-general")
else ()
ADD_H5_FLAGS (H5_CXXFLAGS "${HDF_CONFIG_DIR}/clang-warnings/no-developer-general")
endif ()