-
Notifications
You must be signed in to change notification settings - Fork 700
/
Copy pathmeson.build
166 lines (150 loc) · 3.45 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
pdbgen_backup = false
pdbgen_groups = false
pdb_names = [
'brush_select',
'brush',
'brushes',
'buffer',
'channel',
'context',
'debug',
'display',
'drawable_color',
'drawable_edit',
'drawable_filter',
'drawable_select',
'drawable',
'dynamics',
'edit',
'file',
'floating_sel',
'font',
'font_select',
'fonts',
'gimp',
'gimprc',
'gradient_select',
'gradient',
'gradients',
'group_layer',
'help',
'image_color_profile',
'image_convert',
'image_grid',
'image_guides',
'image_sample_points',
'image_select',
'image_transform',
'image_undo',
'image',
'item_transform',
'item',
'layer',
'message',
'paint_tools',
'palette_select',
'palette',
'palettes',
'path',
'pattern_select',
'pattern',
'patterns',
'pdb',
'plug_in_compat',
'plug_in',
'progress',
'resource',
'selection',
'text_layer',
'text_tool',
'unit',
]
pdb_sources = []
foreach name : pdb_names
pdb_sources += files('groups' / name + '.pdb')
endforeach
enum_headers = [
meson.project_source_root() + '/libgimpbase/gimpbaseenums.h',
meson.project_source_root() + '/libgimpconfig/gimpconfigenums.h',
meson.project_source_root() + '/app/operations/operations-enums.h',
meson.project_source_root() + '/app/core/core-enums.h',
meson.project_source_root() + '/app/paint/paint-enums.h'
]
# Perl environment
perlsrcdir = meson.current_source_dir().replace('\\', '/')
perlbindir = meson.current_build_dir().replace('\\', '/')
perl_env = [
'PDBGEN_BACKUP=' + (pdbgen_backup ? '1' : '0'),
'PDBGEN_GROUPS=' + (pdbgen_groups ? '1' : '0'),
'rootme=' + perlbindir,
'srcdir=' + perlsrcdir,
'destdir=' + meson.project_build_root().replace('\\', '/'),
'builddir=' + meson.project_build_root().replace('\\', '/'),
'topsrcdir=' + meson.project_source_root().replace('\\', '/'),
]
groups_pl_content = '# This file is autogenerated\n'
groups_pl_content += '@groups = qw(\n'
foreach source : pdb_names
groups_pl_content += ' '+ source +'\n'
endforeach
groups_pl_content += ');\n'
# All perl files
groups_pl = custom_target('groups.pl',
input : [ ],
output: [ 'groups.pl', ],
command: [ 'echo', groups_pl_content, ],
capture: true,
)
enumgen_run = find_program('meson-enumgen.sh')
pdbgen_run = find_program('meson-pdbgen.sh')
enumcode_run = find_program('meson-enumcode.sh')
enums_pl = custom_target('enums.pl',
input : [ 'meson-enumgen.sh', 'enumgen.pl', 'enums-external.pl', enum_headers, ],
output: [ 'stamp-enumgen.h', ],
env: perl_env,
command: [
enumgen_run, perl, meson.project_source_root(), meson.project_build_root(),
enum_headers,
],
build_by_default: true,
)
pdbgen = custom_target('stamp-pdbgen.h',
input : [
files(
'meson-pdbgen.sh',
'pdbgen.pl',
'app.pl',
'lib.pl',
'pdb.pl',
'stddefs.pdb',
'util.pl',
),
enums_pl,
groups_pl,
pdb_sources,
],
output: [ 'stamp-pdbgen.h', ],
env: perl_env,
command: [
pdbgen_run, perl, meson.project_source_root(), meson.project_build_root()
],
build_by_default: true,
)
stamp_enumcode = custom_target('gimpenums.h',
input : [
files(
'meson-enumcode.sh',
'enumcode.pl',
'enumgen.pl',
'util.pl',
),
enums_pl,
enum_headers,
],
output: [ 'stamp-enumcode.h', ],
env: perl_env,
command: [
enumcode_run, perl, meson.project_source_root(), meson.project_build_root()
],
build_by_default: true,
)