Skip to content

Commit 2c94899

Browse files
committed
remove duplicate is_executable_target
1 parent d01b8ae commit 2c94899

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/fpm.f90

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -765,17 +765,11 @@ logical function should_be_run(settings,run_scope,exe_target)
765765

766766
integer :: j
767767

768-
if (exe_target%target_type == FPM_TARGET_EXECUTABLE .and. &
769-
allocated(exe_target%dependencies)) then
768+
if (exe_target%is_executable_target(run_scope)) then
770769

771770
associate(exe_source => exe_target%dependencies(1)%ptr%source)
772771

773-
if (exe_source%unit_scope/=run_scope) then
774-
775-
! Other scope
776-
should_be_run = .false.
777-
778-
elseif (size(settings%name) == 0 .or. .not.settings%list) then
772+
if (size(settings%name) == 0 .or. .not.settings%list) then
779773

780774
! No list of targets
781775
should_be_run = .true.

src/fpm_targets.f90

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ module fpm_targets
132132

133133
!> Version number
134134
character(:), allocatable :: version
135+
136+
contains
137+
138+
procedure :: is_executable_target
135139

136140
end type build_target_t
137141

@@ -1043,7 +1047,7 @@ end subroutine filter_executable_targets
10431047

10441048

10451049
elemental function is_executable_target(target_ptr, scope) result(is_exe)
1046-
type(build_target_t), intent(in) :: target_ptr
1050+
class(build_target_t), intent(in) :: target_ptr
10471051
integer, intent(in) :: scope
10481052
logical :: is_exe
10491053
is_exe = target_ptr%target_type == FPM_TARGET_EXECUTABLE .and. &
@@ -1101,5 +1105,4 @@ function get_feature_flags(compiler, features) result(flags)
11011105
end if
11021106
end function get_feature_flags
11031107

1104-
11051108
end module fpm_targets

0 commit comments

Comments
 (0)