Skip to content

Commit

Permalink
feat: added shared metadata inside install table
Browse files Browse the repository at this point in the history
  • Loading branch information
arteevraina committed May 17, 2024
1 parent 88ebb0a commit 5b47b34
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/fpm/manifest/install.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ module fpm_manifest_install
!> Install library with this project
logical :: library = .false.

!> Tells fpm to generate shared library.
logical :: shared = .false.

contains

!> Print information on this instance
Expand Down Expand Up @@ -51,6 +54,7 @@ subroutine new_install_config(self, table, error)
if (allocated(error)) return

call get_value(table, "library", self%library, .false.)
call get_value(table, "shared", self%shared, .false.)

end subroutine new_install_config

Expand All @@ -77,6 +81,8 @@ subroutine check(table, error)
exit
case("library")
continue
case("shared")
continue
end select
end do
if (allocated(error)) return
Expand Down Expand Up @@ -109,6 +115,8 @@ subroutine info(self, unit, verbosity)
write(unit, fmt) "Install configuration"
write(unit, fmt) " - library install", &
& trim(merge("enabled ", "disabled", self%library))
write(unit, fmt) " - shared library", &
& trim(merge("enabled ", "disabled", self%shared))

end subroutine info

Expand All @@ -118,9 +126,11 @@ logical function install_conf_same(this,that)

install_conf_same = .false.


select type (other=>that)
type is (install_config_t)
if (this%library.neqv.other%library) return
if (this%shared.neqv.other%shared) return
class default
! Not the same type
return
Expand All @@ -144,6 +154,7 @@ subroutine dump_to_toml(self, table, error)
type(error_t), allocatable, intent(out) :: error

call set_value(table, "library", self%library, error, class_name)
call set_value(table, "shared", self%shared, error, class_name)

end subroutine dump_to_toml

Expand All @@ -162,6 +173,7 @@ subroutine load_from_toml(self, table, error)
integer :: stat

call get_value(table, "library", self%library, error, class_name)
call get_value(table, "shared", self%shared, error, class_name)
if (allocated(error)) return

end subroutine load_from_toml
Expand Down

0 comments on commit 5b47b34

Please sign in to comment.