aboutsummaryrefslogtreecommitdiff
path: root/src/fpm_targets.f90
diff options
context:
space:
mode:
authorLKedward <laurence.kedward@bristol.ac.uk>2021-04-12 16:39:29 +0100
committerLKedward <laurence.kedward@bristol.ac.uk>2021-04-12 16:44:37 +0100
commita49b0177f8d7ca74b3bfaa325fd37ee614975367 (patch)
treed0455e6d9ebc1514a658d0d3142911dfe9b5d968 /src/fpm_targets.f90
parent0d3611a5f3e7a2d7cb88ec8637a9d898b2ce4cfb (diff)
downloadfpm-a49b0177f8d7ca74b3bfaa325fd37ee614975367.tar.gz
fpm-a49b0177f8d7ca74b3bfaa325fd37ee614975367.zip
Add: external-modules key to build table for non-fpm modules
Diffstat (limited to 'src/fpm_targets.f90')
-rw-r--r--src/fpm_targets.f9010
1 files changed, 8 insertions, 2 deletions
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 => &