From 5b47b344b937611370f41d8f94a2489de7d71fa6 Mon Sep 17 00:00:00 2001 From: arteevraina Date: Fri, 17 May 2024 21:10:55 +0530 Subject: [PATCH] feat: added shared metadata inside install table --- src/fpm/manifest/install.f90 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/fpm/manifest/install.f90 b/src/fpm/manifest/install.f90 index 88c3097eb0..bb6c53d0ec 100644 --- a/src/fpm/manifest/install.f90 +++ b/src/fpm/manifest/install.f90 @@ -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 @@ -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 @@ -77,6 +81,8 @@ subroutine check(table, error) exit case("library") continue + case("shared") + continue end select end do if (allocated(error)) return @@ -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 @@ -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 @@ -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 @@ -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