5
5
! >```toml
6
6
! >[library]
7
7
! >source-dir = "path"
8
- ! >include-dir = "path"
8
+ ! >include-dir = ["path1","path2"]
9
9
! >build-script = "file"
10
10
! >```
11
11
module fpm_manifest_library
12
12
use fpm_error, only : error_t, syntax_error
13
+ use fpm_strings, only: string_t, string_cat
13
14
use fpm_toml, only : toml_table, toml_key, toml_stat, get_value
14
15
implicit none
15
16
private
@@ -24,7 +25,7 @@ module fpm_manifest_library
24
25
character (len= :), allocatable :: source_dir
25
26
26
27
! > Include path prefix
27
- character (len = : ), allocatable :: include_dir
28
+ type (string_t ), allocatable :: include_dir(:)
28
29
29
30
! > Alternative build script to be invoked
30
31
character (len= :), allocatable :: build_script
@@ -56,9 +57,16 @@ subroutine new_library(self, table, error)
56
57
if (allocated (error)) return
57
58
58
59
call get_value(table, " source-dir" , self% source_dir, " src" )
59
- call get_value(table, " include-dir" , self% include_dir, " include" )
60
60
call get_value(table, " build-script" , self% build_script)
61
61
62
+ call get_value(table, " include-dir" , self% include_dir, error)
63
+ if (allocated (error)) return
64
+
65
+ ! Set default value of include-dir if not found in manifest
66
+ if (.not. allocated (self% include_dir)) then
67
+ self% include_dir = [string_t(" include" )]
68
+ end if
69
+
62
70
end subroutine new_library
63
71
64
72
@@ -122,7 +130,7 @@ subroutine info(self, unit, verbosity)
122
130
write (unit, fmt) " - source directory" , self% source_dir
123
131
end if
124
132
if (allocated (self% include_dir)) then
125
- write (unit, fmt) " - include directory" , self% include_dir
133
+ write (unit, fmt) " - include directory" , string_cat( self% include_dir, " , " )
126
134
end if
127
135
if (allocated (self% build_script)) then
128
136
write (unit, fmt) " - custom build" , self% build_script
0 commit comments