瀏覽代碼

Tests/FortranModules: also test INTERFACE targets with Fortran sources

Ben Boeckel 2 年之前
父節點
當前提交
e3d511fb9c

+ 1 - 0
Tests/FortranModules/CMakeLists.txt

@@ -131,4 +131,5 @@ add_subdirectory(Issue25223)
 if( # Intel Fortran VS Integration breaks on custom targets with Fortran sources
     NOT CMAKE_GENERATOR MATCHES "Visual Studio")
   add_subdirectory(Issue25252)
+  add_subdirectory(Issue25252-iface-target)
 endif()

+ 5 - 0
Tests/FortranModules/Issue25252-iface-target/CMakeLists.txt

@@ -0,0 +1,5 @@
+add_library(fortran_source_iface INTERFACE
+  iface.f90)
+
+add_library(lib25252-iface-target lib.f90)
+add_dependencies(lib25252-iface-target fortran_source_iface)

+ 5 - 0
Tests/FortranModules/Issue25252-iface-target/iface.f90

@@ -0,0 +1,5 @@
+program main
+
+implicit none
+
+end program

+ 11 - 0
Tests/FortranModules/Issue25252-iface-target/lib.f90

@@ -0,0 +1,11 @@
+module lib
+
+implicit none
+
+contains
+
+pure real function func()
+func = 1.0
+end function
+
+end module