Skip to content

Commit 1019e93

Browse files
committed
Update: info_model for source grouping
1 parent 1699b71 commit 1019e93

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

fpm/src/fpm_model.f90

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,25 @@ function info_build_target_short(t) result(s)
292292
s = s // ", ...)"
293293
end function
294294

295+
function info_package(p) result(s)
296+
! Returns representation of package_t
297+
type(package_t), intent(in) :: p
298+
character(:), allocatable :: s
299+
300+
integer :: i
301+
302+
s = s // 'package_t('
303+
s = s // 'name="' // p%name //'"'
304+
s = s // ', sources=['
305+
do i = 1, size(p%sources)
306+
s = s // info_srcfile(p%sources(i))
307+
if (i < size(p%sources)) s = s // ", "
308+
end do
309+
s = s // "]"
310+
s = s // ")"
311+
312+
end function info_package
313+
295314
function info_srcfile(source) result(s)
296315
type(srcfile_t), intent(in) :: source
297316
character(:), allocatable :: s
@@ -393,10 +412,10 @@ function info_model(model) result(s)
393412
! character(:), allocatable :: package_name
394413
s = s // 'package_name="' // model%package_name // '"'
395414
! type(srcfile_t), allocatable :: sources(:)
396-
s = s // ", sources=["
397-
do i = 1, size(model%sources)
398-
s = s // info_srcfile(model%sources(i))
399-
if (i < size(model%sources)) s = s // ", "
415+
s = s // ", packages=["
416+
do i = 1, size(model%packages)
417+
s = s // info_package(model%packages(i))
418+
if (i < size(model%packages)) s = s // ", "
400419
end do
401420
s = s // "]"
402421
! type(build_target_ptr), allocatable :: targets(:)

0 commit comments

Comments
 (0)