diff options
author | Laurence Kedward <laurence.kedward@bristol.ac.uk> | 2021-04-16 16:07:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-16 16:07:55 +0100 |
commit | 4cbf9194e47991a208cd61b1f3a0a55f0ae16573 (patch) | |
tree | cbb083bd19a22a1236c31de991409ce06b595748 /src/fpm_targets.f90 | |
parent | a540c83d9e303acd6fece95927c49fa8d2565366 (diff) | |
parent | c80169d9ad9e619e9c022eedb2313e62ca4ef0a9 (diff) | |
download | fpm-4cbf9194e47991a208cd61b1f3a0a55f0ae16573.tar.gz fpm-4cbf9194e47991a208cd61b1f3a0a55f0ae16573.zip |
Merge pull request #438 from LKedward/external-mods
Add: external-modules key to build table for non-fpm modules
Diffstat (limited to 'src/fpm_targets.f90')
-rw-r--r-- | src/fpm_targets.f90 | 10 |
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 => & |