From e055929a52a47905dd3f04794dfd6f427d6787d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Wed, 23 Dec 2020 10:08:05 -0700 Subject: Implement info_build_target_short() --- fpm/src/fpm_model.f90 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/fpm/src/fpm_model.f90 b/fpm/src/fpm_model.f90 index 1d72e82..d1ac015 100644 --- a/fpm/src/fpm_model.f90 +++ b/fpm/src/fpm_model.f90 @@ -197,7 +197,7 @@ end type fpm_model_t contains -recursive function info_build_target(t) result(s) +function info_build_target(t) result(s) type(build_target_t), intent(in) :: t character(:), allocatable :: s integer :: i @@ -215,10 +215,7 @@ recursive function info_build_target(t) result(s) s = s // ", dependencies=[" if (allocated(t%dependencies)) then do i = 1, size(t%dependencies) - ! TODO: This compiles, but it hangs at runtime due to infinite - ! recursion, so for now we just print "..." - !s = s // info_build_target(t%dependencies(i)%ptr) - s = s // "build_target_t(...)" + s = s // info_build_target_short(t%dependencies(i)%ptr) if (i < size(t%dependencies)) s = s // ", " end do end if @@ -273,6 +270,16 @@ recursive function info_build_target(t) result(s) s = s // ")" end function +function info_build_target_short(t) result(s) + ! Prints a shortened representation of build_target_t + type(build_target_t), intent(in) :: t + character(:), allocatable :: s + integer :: i + s = "build_target_t(" + s = s // 'output_file="' // t%output_file // '"' + s = s // ", ...)" +end function + function info_srcfile(source) result(s) type(srcfile_t), intent(in) :: source character(:), allocatable :: s -- cgit v1.2.3