diff options
author | Ondřej Čertík <ondrej@certik.us> | 2020-12-23 10:08:05 -0700 |
---|---|---|
committer | Ondřej Čertík <ondrej@certik.us> | 2020-12-23 10:08:05 -0700 |
commit | e055929a52a47905dd3f04794dfd6f427d6787d2 (patch) | |
tree | 9d508560afad2e736a1b26c5e14c818adf1ca542 | |
parent | d34e902969fe38f777d78df545e1a8c6603e99e9 (diff) | |
download | fpm-e055929a52a47905dd3f04794dfd6f427d6787d2.tar.gz fpm-e055929a52a47905dd3f04794dfd6f427d6787d2.zip |
Implement info_build_target_short()
-rw-r--r-- | fpm/src/fpm_model.f90 | 17 |
1 files 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 |