Skip to content

Commit e055929

Browse files
committed
Implement info_build_target_short()
1 parent d34e902 commit e055929

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

fpm/src/fpm_model.f90

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ module fpm_model
197197

198198
contains
199199

200-
recursive function info_build_target(t) result(s)
200+
function info_build_target(t) result(s)
201201
type(build_target_t), intent(in) :: t
202202
character(:), allocatable :: s
203203
integer :: i
@@ -215,10 +215,7 @@ recursive function info_build_target(t) result(s)
215215
s = s // ", dependencies=["
216216
if (allocated(t%dependencies)) then
217217
do i = 1, size(t%dependencies)
218-
! TODO: This compiles, but it hangs at runtime due to infinite
219-
! recursion, so for now we just print "..."
220-
!s = s // info_build_target(t%dependencies(i)%ptr)
221-
s = s // "build_target_t(...)"
218+
s = s // info_build_target_short(t%dependencies(i)%ptr)
222219
if (i < size(t%dependencies)) s = s // ", "
223220
end do
224221
end if
@@ -273,6 +270,16 @@ recursive function info_build_target(t) result(s)
273270
s = s // ")"
274271
end function
275272

273+
function info_build_target_short(t) result(s)
274+
! Prints a shortened representation of build_target_t
275+
type(build_target_t), intent(in) :: t
276+
character(:), allocatable :: s
277+
integer :: i
278+
s = "build_target_t("
279+
s = s // 'output_file="' // t%output_file // '"'
280+
s = s // ", ...)"
281+
end function
282+
276283
function info_srcfile(source) result(s)
277284
type(srcfile_t), intent(in) :: source
278285
character(:), allocatable :: s

0 commit comments

Comments
 (0)