aboutsummaryrefslogtreecommitdiff
path: root/src/fpm_targets.f90
diff options
context:
space:
mode:
authorSebastian Ehlert <28669218+awvwgk@users.noreply.github.com>2021-10-10 17:58:32 +0200
committerSebastian Ehlert <28669218+awvwgk@users.noreply.github.com>2021-10-10 17:59:33 +0200
commit6f816ad20ffe8897feec9a8a91ab8c7bf1d2d753 (patch)
tree12af4d09f3467db927d719397edfdfad2a871ab4 /src/fpm_targets.f90
parente90eee715634a9378b86a111d70613b1eeedd64b (diff)
downloadfpm-6f816ad20ffe8897feec9a8a91ab8c7bf1d2d753.tar.gz
fpm-6f816ad20ffe8897feec9a8a91ab8c7bf1d2d753.zip
Correctly install modulefiles from build targets
Diffstat (limited to 'src/fpm_targets.f90')
-rw-r--r--src/fpm_targets.f9025
1 files changed, 24 insertions, 1 deletions
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