@@ -675,7 +675,7 @@ logical function package_is_same(this,that)
675
675
end do
676
676
end if
677
677
678
- if (.not. (this% macros == other% macros )) return
678
+ if (.not. (this% preprocess == other% preprocess )) return
679
679
if (.not. (this% version== other% version)) return
680
680
681
681
! > Module naming
@@ -723,7 +723,10 @@ subroutine package_dump_to_toml(self, table, error)
723
723
call set_string(table, " module-prefix" , self% module_prefix, error, ' package_t' )
724
724
if (allocated (error)) return
725
725
726
- call set_list(table, " macros" , self% macros, error)
726
+ ! > Create a preprocessor table
727
+ call add_table(table, " preprocess" , ptr, error, ' package_t' )
728
+ if (allocated (error)) return
729
+ call self% preprocess% dump_to_toml(ptr, error)
727
730
if (allocated (error)) return
728
731
729
732
! > Create a fortran table
@@ -768,7 +771,7 @@ subroutine package_load_from_toml(self, table, error)
768
771
769
772
integer :: ierr,ii,jj
770
773
type (toml_key), allocatable :: keys(:),src_keys(:)
771
- type (toml_table), pointer :: ptr_sources,ptr,ptr_fortran
774
+ type (toml_table), pointer :: ptr_sources,ptr,ptr_fortran,ptr_preprocess
772
775
type (error_t), allocatable :: new_error
773
776
774
777
call get_value(table, " name" , self% name)
@@ -780,9 +783,6 @@ subroutine package_load_from_toml(self, table, error)
780
783
! Return unallocated value if not present
781
784
call get_value(table, " module-prefix" , self% module_prefix% s)
782
785
783
- call get_list(table, " macros" , self% macros, error)
784
- if (allocated (error)) return
785
-
786
786
! Sources
787
787
call table% get_keys(keys)
788
788
@@ -799,6 +799,17 @@ subroutine package_load_from_toml(self, table, error)
799
799
call self% features% load_from_toml(ptr_fortran,error)
800
800
if (allocated (error)) return
801
801
802
+ case (" preprocess" )
803
+
804
+ call get_value(table, keys(ii), ptr_preprocess)
805
+ if (.not. associated (ptr_preprocess)) then
806
+ call fatal_error(error,' package_t: error retrieving preprocess table from TOML table' )
807
+ return
808
+ end if
809
+
810
+ call self% preprocess% load_from_toml(ptr_preprocess,error)
811
+ if (allocated (error)) return
812
+
802
813
case (" sources" )
803
814
804
815
call get_value(table, keys(ii), ptr_sources)
0 commit comments