diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake index 4f033e3bec..dc15e556e7 100644 --- a/Modules/CMakeFortranInformation.cmake +++ b/Modules/CMakeFortranInformation.cmake @@ -178,9 +178,10 @@ IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH) ENDIF() # compile a Fortran file into an object file +# (put -o after -c to workaround bug in at least one mpif77 wrapper) IF(NOT CMAKE_Fortran_COMPILE_OBJECT) SET(CMAKE_Fortran_COMPILE_OBJECT - " -o -c ") + " -c -o ") ENDIF(NOT CMAKE_Fortran_COMPILE_OBJECT) # link a fortran program