mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 15:10:20 -06:00
Tests/FortranModules: add test for TARGET_OBJECTS-as-sources module usage
Test module usage across a `$<TARGET_OBJECTS>`-as-sources use case. See: #25425
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
add_subdirectory(subdir)
|
||||
|
||||
add_library(mvstos_lib "$<TARGET_OBJECTS:mvstos_obj>")
|
||||
target_include_directories(mvstos_lib PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/subdir")
|
||||
add_library(mvstos_use use.f90)
|
||||
target_link_libraries(mvstos_use PRIVATE mvstos_lib)
|
||||
@@ -0,0 +1 @@
|
||||
add_library(mvstos_obj OBJECT obj.f90)
|
||||
@@ -0,0 +1,11 @@
|
||||
module m1
|
||||
|
||||
implicit none
|
||||
|
||||
contains
|
||||
|
||||
pure real function pi()
|
||||
pi = 4*atan(1.)
|
||||
end function
|
||||
|
||||
end module m1
|
||||
@@ -0,0 +1,13 @@
|
||||
module lib
|
||||
|
||||
use m1, only : pi
|
||||
|
||||
implicit none
|
||||
|
||||
contains
|
||||
|
||||
pure real function func()
|
||||
func = pi()
|
||||
end function
|
||||
|
||||
end module
|
||||
Reference in New Issue
Block a user