From 6f816ad20ffe8897feec9a8a91ab8c7bf1d2d753 Mon Sep 17 00:00:00 2001 From: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> Date: Sun, 10 Oct 2021 17:58:32 +0200 Subject: Correctly install modulefiles from build targets --- src/fpm_targets.f90 | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/fpm_targets.f90') diff --git a/src/fpm_targets.f90 b/src/fpm_targets.f90 index 788a5ce..87809e6 100644 --- a/src/fpm_targets.f90 +++ b/src/fpm_targets.f90 @@ -40,7 +40,7 @@ public FPM_TARGET_UNKNOWN, FPM_TARGET_EXECUTABLE, & public build_target_t, build_target_ptr public targets_from_sources, resolve_module_dependencies public resolve_target_linking, add_target, add_dependency -public filter_library_targets, filter_executable_targets +public filter_library_targets, filter_executable_targets, filter_modules @@ -678,4 +678,27 @@ elemental function is_executable_target(target_ptr, scope) result(is_exe) end function is_executable_target +subroutine filter_modules(targets, list) + type(build_target_ptr), intent(in) :: targets(:) + type(string_t), allocatable, intent(out) :: list(:) + + integer :: i, j, n + + n = 0 + call resize(list) + do i = 1, size(targets) + associate(target => targets(i)%ptr) + if (.not.allocated(target%source)) cycle + if (n + size(target%source%modules_provided) >= size(list)) call resize(list) + do j = 1, size(target%source%modules_provided) + n = n + 1 + list(n)%s = join_path(target%output_dir, "fpm", & + target%source%modules_provided(j)%s) + end do + end associate + end do + call resize(list, n) +end subroutine filter_modules + + end module fpm_targets -- cgit v1.2.3