@@ -32,6 +32,8 @@ module fpm_manifest_dependency
32
32
use fpm_manifest_metapackages, only: metapackage_config_t, is_meta_package, new_meta_config, &
33
33
metapackage_request_t, new_meta_request
34
34
use fpm_versioning, only: version_t, new_version
35
+ use fpm_strings, only: string_t
36
+ use fpm_manifest_preprocess
35
37
implicit none
36
38
private
37
39
@@ -55,6 +57,9 @@ module fpm_manifest_dependency
55
57
! > The latest version is used if not specified.
56
58
type (version_t), allocatable :: requested_version
57
59
60
+ ! > Requested macros for the dependency
61
+ type (preprocess_config_t), allocatable :: preprocess(:)
62
+
58
63
! > Git descriptor
59
64
type (git_target_t), allocatable :: git
60
65
@@ -87,6 +92,8 @@ subroutine new_dependency(self, table, root, error)
87
92
88
93
character (len= :), allocatable :: uri, value, requested_version
89
94
95
+ type (toml_table), pointer :: child
96
+
90
97
call check(table, error)
91
98
if (allocated (error)) return
92
99
@@ -136,6 +143,13 @@ subroutine new_dependency(self, table, root, error)
136
143
if (allocated (error)) return
137
144
end if
138
145
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
+
139
153
end subroutine new_dependency
140
154
141
155
! > Check local schema for allowed entries
@@ -158,7 +172,8 @@ subroutine check(table, error)
158
172
" git" , &
159
173
" tag" , &
160
174
" branch" , &
161
- " rev" &
175
+ " rev" , &
176
+ " preprocess" &
162
177
& ]
163
178
164
179
call table% get_key(name)
@@ -170,6 +185,7 @@ subroutine check(table, error)
170
185
end if
171
186
172
187
call check_keys(table, valid_keys, error)
188
+ print * , ' check keys ' ,allocated (error)
173
189
if (allocated (error)) return
174
190
175
191
if (table% has_key(" path" ) .and. table% has_key(" git" )) then
0 commit comments