diff options
-rw-r--r-- | fpm/src/FPM_Backend.f90 | 4 | ||||
-rw-r--r-- | fpm/src/FPM_Sourcefiles.f90 | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/fpm/src/FPM_Backend.f90 b/fpm/src/FPM_Backend.f90 index f52efb3..d0aaa19 100644 --- a/fpm/src/FPM_Backend.f90 +++ b/fpm/src/FPM_Backend.f90 @@ -30,7 +30,9 @@ recursive subroutine build_source(source_file,linking) do i=1,size(source_file%file_dependencies) - call build_source(source_file%file_dependencies(i)%ptr,linking) + if (associated(source_file%file_dependencies(i)%ptr)) then + call build_source(source_file%file_dependencies(i)%ptr,linking) + end if end do diff --git a/fpm/src/FPM_Sourcefiles.f90 b/fpm/src/FPM_Sourcefiles.f90 index 33c0de2..b613423 100644 --- a/fpm/src/FPM_Sourcefiles.f90 +++ b/fpm/src/FPM_Sourcefiles.f90 @@ -348,6 +348,8 @@ subroutine resolve_dependencies(sources) do j=1,n_depend + sources(i)%file_dependencies(j)%ptr => NULL() + do k=1,size(sources) if (sources(i)%module_dependencies(j)%s == sources(k)%unit_name) then |