Skip to content

Commit e9cddad

Browse files
committed
add preprocess_config to the dependency struct
1 parent 3f511db commit e9cddad

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/fpm/manifest/dependency.f90

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ module fpm_manifest_dependency
3232
use fpm_manifest_metapackages, only: metapackage_config_t, is_meta_package, new_meta_config, &
3333
metapackage_request_t, new_meta_request
3434
use fpm_versioning, only: version_t, new_version
35+
use fpm_strings, only: string_t
36+
use fpm_manifest_preprocess
3537
implicit none
3638
private
3739

@@ -55,6 +57,9 @@ module fpm_manifest_dependency
5557
!> The latest version is used if not specified.
5658
type(version_t), allocatable :: requested_version
5759

60+
!> Requested macros for the dependency
61+
type(preprocess_config_t), allocatable :: preprocess(:)
62+
5863
!> Git descriptor
5964
type(git_target_t), allocatable :: git
6065

@@ -87,6 +92,8 @@ subroutine new_dependency(self, table, root, error)
8792

8893
character(len=:), allocatable :: uri, value, requested_version
8994

95+
type(toml_table), pointer :: child
96+
9097
call check(table, error)
9198
if (allocated(error)) return
9299

@@ -136,6 +143,13 @@ subroutine new_dependency(self, table, root, error)
136143
if (allocated(error)) return
137144
end if
138145

146+
!> Get optional preprocessor directives
147+
call get_value(table, "preprocess", child, requested=.false.)
148+
if (associated(child)) then
149+
call new_preprocessors(self%preprocess, child, error)
150+
if (allocated(error)) return
151+
end if
152+
139153
end subroutine new_dependency
140154

141155
!> Check local schema for allowed entries
@@ -158,7 +172,8 @@ subroutine check(table, error)
158172
"git", &
159173
"tag", &
160174
"branch", &
161-
"rev" &
175+
"rev", &
176+
"preprocess" &
162177
& ]
163178

164179
call table%get_key(name)
@@ -170,6 +185,7 @@ subroutine check(table, error)
170185
end if
171186

172187
call check_keys(table, valid_keys, error)
188+
print *, 'check keys ',allocated(error)
173189
if (allocated(error)) return
174190

175191
if (table%has_key("path") .and. table%has_key("git")) then

0 commit comments

Comments
 (0)