diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-04-05 18:38:04 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-04-05 18:38:04 (GMT) |
commit | 2c2627e7f66ae9a7c333ad250101f97ae65178ab (patch) | |
tree | 49e2c4a387fb45f10d968d9e5fea4c9f4534a0fa /config/cmake/HDFFortranCompilerFlags.cmake | |
parent | 70495751c05c4471be3a55b0e933e4d1e73d79c5 (diff) | |
download | hdf5-2c2627e7f66ae9a7c333ad250101f97ae65178ab.zip hdf5-2c2627e7f66ae9a7c333ad250101f97ae65178ab.tar.gz hdf5-2c2627e7f66ae9a7c333ad250101f97ae65178ab.tar.bz2 |
Flag construction must be after compiler detection
Diffstat (limited to 'config/cmake/HDFFortranCompilerFlags.cmake')
-rw-r--r-- | config/cmake/HDFFortranCompilerFlags.cmake | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake index 8d59cd0..64afb2a 100644 --- a/config/cmake/HDFFortranCompilerFlags.cmake +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -28,12 +28,11 @@ macro (ADD_H5_FFLAGS h5_fflag_var infile) #message (STATUS "h5_fflag_var=${${h5_fflag_var}}") endmacro () -message (STATUS "Warnings Configuration: default: ${CMAKE_Fortran_FLAGS}") +message (STATUS "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") #----------------------------------------------------------------------------- # Option to allow the user to disable compiler warnings #----------------------------------------------------------------------------- -option (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF) if (HDF5_DISABLE_COMPILER_WARNINGS) message (STATUS "....Compiler warnings are suppressed") # MSVC uses /w to suppress warnings. It also complains if another @@ -64,68 +63,68 @@ endif () # General flags if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") - ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-ifort-general") - list (APPEND CMAKE_Fortran_FLAGS "-stand f08 -free -implicitnone") + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-ifort-general") + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-stand f08 -free -implicitnone") elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") - ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-general") - list (APPEND CMAKE_Fortran_FLAGS "-ffree-form -std=f2008 -fimplicit-none") + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-general") + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-ffree-form -std=f2008 -fimplicit-none") elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI") - list (APPEND CMAKE_Fortran_FLAGS "-Mfreeform -Mdclchk -Mstandard -Mallocatable=03") + list (APPEND HDF5_CMAKE_Fortran_FLAGS "-Mfreeform -Mdclchk -Mstandard -Mallocatable=03") endif () -message (STATUS "CMAKE_Fortran_FLAGS=${CMAKE_Fortran_FLAGS}") +message (STATUS "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") # Append warning flags that only gcc 4.4+ knows about - ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.4") + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.4") endif () # Append more extra warning flags that only gcc 4.5+ know about if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.5) - ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.5") + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.5") endif () # Append more extra warning flags that only gcc 4.6+ know about #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.6) -# ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.6") +# ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.6") #endif () # Append more extra warning flags that only gcc 4.7+ know about if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.7) - ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.7") + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.7") endif () # Append more extra warning flags that only gcc 4.8+ know about if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.8) - ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.8") + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.8") endif () # Append more extra warning flags that only gcc 4.9+ know about #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.9) -# ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.9") +# ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.9") #endif () # Append more extra warning flags that only gcc 5.1+ know about if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0) - ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5") + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5") endif () # Append more extra warning flags that only gcc 6.x+ know about if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 6.0) - ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-6") + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-6") endif () # Append more extra warning flags that only gcc 7.x+ know about #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0) -# ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-7") +# ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-7") #endif () # Append more extra warning flags that only gcc 8.x+ know about if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0) - ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-8") + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-8") endif () # Append more extra warning flags that only gcc 9.x+ know about #if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 9.0) -# ADD_H5_FLAGS (CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-9") +# ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-9") #endif () |