diff options
author | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2015-05-07 18:23:09 (GMT) |
---|---|---|
committer | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2015-05-07 18:23:09 (GMT) |
commit | 9dc86e2cde33766cf7eea5d0b92e032f283a6a13 (patch) | |
tree | 1b73afe66fc8274a7ef0cd3d41898c3f15adb9b4 | |
parent | 8f82c9b8be875cd28e18402e920f8e162d8f8d38 (diff) | |
download | hdf5-9dc86e2cde33766cf7eea5d0b92e032f283a6a13.zip hdf5-9dc86e2cde33766cf7eea5d0b92e032f283a6a13.tar.gz hdf5-9dc86e2cde33766cf7eea5d0b92e032f283a6a13.tar.bz2 |
[svn-r27035] Do not pass warnings options to non-gnu compilers when compiling with CMake
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cacc5d..a3d537c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -472,7 +472,7 @@ endif (HDF5_DISABLE_COMPILER_WARNINGS) # CDash is configured to only allow 3000 warnings, so # break into groups (from the config/gnu-flags file) #----------------------------------------------------------------------------- -if (NOT MSVC) +if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline") else (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") @@ -535,7 +535,7 @@ if (NOT MSVC) # Append more extra warning flags that only gcc 4.7+ know about set (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") -endif (NOT MSVC) +endif (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) #----------------------------------------------------------------------------- # Option to allow the user to enable all warnings @@ -548,7 +548,9 @@ if (HDF5_ENABLE_ALL_WARNINGS) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") else (MSVC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") + if (CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") + endif (CMAKE_COMPILER_IS_GNUCC) endif (MSVC) endif (HDF5_ENABLE_ALL_WARNINGS) @@ -563,7 +565,9 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") else (MSVC) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") + if (CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") + endif (CMAKE_COMPILER_IS_GNUCC) endif (MSVC) endif (HDF5_ENABLE_GROUPZERO_WARNINGS) |