From a49b0177f8d7ca74b3bfaa325fd37ee614975367 Mon Sep 17 00:00:00 2001 From: LKedward Date: Mon, 12 Apr 2021 16:39:29 +0100 Subject: Add: external-modules key to build table for non-fpm modules --- src/fpm_targets.f90 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/fpm_targets.f90') diff --git a/src/fpm_targets.f90 b/src/fpm_targets.f90 index 02bb600..671145d 100644 --- a/src/fpm_targets.f90 +++ b/src/fpm_targets.f90 @@ -121,7 +121,7 @@ subroutine targets_from_sources(targets,model,error) call build_target_list(targets,model) - call resolve_module_dependencies(targets,error) + call resolve_module_dependencies(targets,model%external_modules,error) if (allocated(error)) return call resolve_target_linking(targets,model) @@ -345,8 +345,9 @@ end subroutine add_dependency !> a source file in the package of the correct scope, then a __fatal error__ !> is returned by the procedure and model construction fails. !> -subroutine resolve_module_dependencies(targets,error) +subroutine resolve_module_dependencies(targets,external_modules,error) type(build_target_ptr), intent(inout), target :: targets(:) + type(string_t), intent(in) :: external_modules(:) type(error_t), allocatable, intent(out) :: error type(build_target_ptr) :: dep @@ -364,6 +365,11 @@ subroutine resolve_module_dependencies(targets,error) cycle end if + if (targets(i)%ptr%source%modules_used(j)%s .in. external_modules) then + ! Dependency satisfied in system-installed module + cycle + end if + if (any(targets(i)%ptr%source%unit_scope == & [FPM_SCOPE_APP, FPM_SCOPE_EXAMPLE, FPM_SCOPE_TEST])) then dep%ptr => & -- cgit v1.2.3