浏览代码

ENH: only check for module linkage if f90 is available

Bill Hoffman 17 年之前
父节点
当前提交
351ef7c187
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      Modules/FortranCInterface.cmake

+ 4 - 1
Modules/FortranCInterface.cmake

@@ -169,7 +169,10 @@ function(create_fortran_c_interface NAMESPACE FUNCTIONS HEADER)
     set(prefix )
     set(suffix )
     set(found FALSE)
-    discover_fortran_module_mangling(prefix suffix found)
+    # only try this if the compiler is F90 compatible
+    if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
+      discover_fortran_module_mangling(prefix suffix found)
+    endif(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
     if(found)
       message(STATUS "found Fortran module linkage")
       set(FORTRAN_C_MODULE_PREFIX "${prefix}" CACHE INTERNAL