diff options
Diffstat (limited to 'config/cmake/HDFCompilerFlags.cmake')
-rw-r--r-- | config/cmake/HDFCompilerFlags.cmake | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 5faffc2..03c6936 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -105,7 +105,7 @@ endif () # CDash is configured to only allow 3000 warnings, so # break into groups (from the config/gnu-flags file) #----------------------------------------------------------------------------- -if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) +if (NOT MSVC) if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") list (APPEND HDF5_CMAKE_C_FLAGS "-erroff=%none -DBSD_COMP") else () @@ -137,6 +137,12 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) # gcc automatically inlines based on the optimization level # this is just a failsafe list (APPEND H5_CFLAGS0 "-finline-functions") + elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") + ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") + message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general") + elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI") + list (APPEND HDF5_CMAKE_C_FLAGS "-Minform=inform") endif () endif () @@ -151,10 +157,14 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) 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 () @@ -265,8 +275,6 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0) ADD_H5_FLAGS (H5_CFLAGS4 "${HDF5_SOURCE_DIR}/config/gnu-warnings/9") endif () -elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI") - list (APPEND HDF5_CMAKE_C_FLAGS "-Minform=inform") endif () #----------------------------------------------------------------------------- |