Skip to content

Commit a8efbbb

Browse files
committed
Update install.f90
1 parent 0352130 commit a8efbbb

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/fpm/cmd/install.f90

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ subroutine cmd_install(settings)
2929
type(build_target_ptr), allocatable :: targets(:), libraries(:)
3030
type(installer_t) :: installer
3131
type(string_t), allocatable :: list(:)
32-
logical :: installable, has_install_config, with_library, with_tests
32+
logical :: installable, has_install, with_library, with_tests
3333
logical :: has_library, has_executables
3434
character(len=:), allocatable :: module_dir
3535
integer :: ntargets,i
@@ -41,16 +41,19 @@ subroutine cmd_install(settings)
4141
call handle_error(error)
4242

4343
! Set up logical variables to avoid repetitive conditions
44-
has_install_config = allocated(package%install)
45-
with_library = has_install_config .and. package%install%library
46-
with_tests = has_install_config .and. package%install%test
47-
has_library = allocated(package%library)
48-
has_executables = allocated(package%executable)
44+
has_install = allocated(package%install)
45+
has_library = allocated(package%library)
46+
has_executables = allocated(package%executable)
47+
if (has_install) then
48+
with_library = has_install .and. package%install%library
49+
with_tests = has_install .and. package%install%test
50+
! Set module directory (or leave unallocated because `optional`)
51+
if (allocated(package%install%module_dir)) module_dir = package%install%module_dir
52+
else
53+
with_library = .false.
54+
with_tests = .false.
55+
endif
4956

50-
! Set module directory (or leave unallocated because `optional`)
51-
if (has_install_config .and. allocated(package%install%module_dir)) &
52-
module_dir = package%install%module_dir
53-
5457
! ifx bug: does not resolve allocatable -> optional
5558
if (has_library) then
5659
call targets_from_sources(targets, model, settings%prune, package%library, error)

0 commit comments

Comments
 (0)