xref: /aosp_15_r20/external/harfbuzz_ng/src/meson.build (revision 2d1272b857b1f7575e6e246373e1cb218663db8a)
1*2d1272b8SAndroid Build Coastguard Workerfs = import('fs')
2*2d1272b8SAndroid Build Coastguard Worker
3*2d1272b8SAndroid Build Coastguard Workerhb_version_h = configure_file(
4*2d1272b8SAndroid Build Coastguard Worker               command: [find_program('gen-hb-version.py'), meson.project_version(), '@OUTPUT@', '@INPUT@'],
5*2d1272b8SAndroid Build Coastguard Worker               input: 'hb-version.h.in',
6*2d1272b8SAndroid Build Coastguard Worker               output: 'hb-version.h',
7*2d1272b8SAndroid Build Coastguard Worker               install: true,
8*2d1272b8SAndroid Build Coastguard Worker               install_dir: get_option('includedir') / meson.project_name())
9*2d1272b8SAndroid Build Coastguard Worker
10*2d1272b8SAndroid Build Coastguard Worker# Base and default-included sources and headers
11*2d1272b8SAndroid Build Coastguard Workerhb_base_sources = files(
12*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-layout-ankr-table.hh',
13*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-layout-bsln-table.hh',
14*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-layout-common.hh',
15*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-layout-feat-table.hh',
16*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-layout-just-table.hh',
17*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-layout-kerx-table.hh',
18*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-layout-morx-table.hh',
19*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-layout-opbd-table.hh',
20*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-layout-trak-table.hh',
21*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-layout.cc',
22*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-layout.hh',
23*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-ltag-table.hh',
24*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-map.cc',
25*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-map.hh',
26*2d1272b8SAndroid Build Coastguard Worker  'hb-algs.hh',
27*2d1272b8SAndroid Build Coastguard Worker  'hb-array.hh',
28*2d1272b8SAndroid Build Coastguard Worker  'hb-atomic.hh',
29*2d1272b8SAndroid Build Coastguard Worker  'hb-bimap.hh',
30*2d1272b8SAndroid Build Coastguard Worker  'hb-bit-page.hh',
31*2d1272b8SAndroid Build Coastguard Worker  'hb-blob.cc',
32*2d1272b8SAndroid Build Coastguard Worker  'hb-blob.hh',
33*2d1272b8SAndroid Build Coastguard Worker  'hb-buffer-serialize.cc',
34*2d1272b8SAndroid Build Coastguard Worker  'hb-buffer-verify.cc',
35*2d1272b8SAndroid Build Coastguard Worker  'hb-buffer.cc',
36*2d1272b8SAndroid Build Coastguard Worker  'hb-buffer.hh',
37*2d1272b8SAndroid Build Coastguard Worker  'hb-cache.hh',
38*2d1272b8SAndroid Build Coastguard Worker  'hb-cff-interp-common.hh',
39*2d1272b8SAndroid Build Coastguard Worker  'hb-cff-interp-cs-common.hh',
40*2d1272b8SAndroid Build Coastguard Worker  'hb-cff-interp-dict-common.hh',
41*2d1272b8SAndroid Build Coastguard Worker  'hb-cff1-interp-cs.hh',
42*2d1272b8SAndroid Build Coastguard Worker  'hb-cff2-interp-cs.hh',
43*2d1272b8SAndroid Build Coastguard Worker  'hb-common.cc',
44*2d1272b8SAndroid Build Coastguard Worker  'hb-config.hh',
45*2d1272b8SAndroid Build Coastguard Worker  'hb-debug.hh',
46*2d1272b8SAndroid Build Coastguard Worker  'hb-dispatch.hh',
47*2d1272b8SAndroid Build Coastguard Worker  'hb-draw.cc',
48*2d1272b8SAndroid Build Coastguard Worker  'hb-draw.hh',
49*2d1272b8SAndroid Build Coastguard Worker  'hb-geometry.hh',
50*2d1272b8SAndroid Build Coastguard Worker  'hb-paint.cc',
51*2d1272b8SAndroid Build Coastguard Worker  'hb-paint.hh',
52*2d1272b8SAndroid Build Coastguard Worker  'hb-paint-extents.cc',
53*2d1272b8SAndroid Build Coastguard Worker  'hb-paint-extents.hh',
54*2d1272b8SAndroid Build Coastguard Worker  'hb-face.cc',
55*2d1272b8SAndroid Build Coastguard Worker  'hb-face.hh',
56*2d1272b8SAndroid Build Coastguard Worker  'hb-face-builder.cc',
57*2d1272b8SAndroid Build Coastguard Worker  'hb-fallback-shape.cc',
58*2d1272b8SAndroid Build Coastguard Worker  'hb-font.cc',
59*2d1272b8SAndroid Build Coastguard Worker  'hb-font.hh',
60*2d1272b8SAndroid Build Coastguard Worker  'hb-iter.hh',
61*2d1272b8SAndroid Build Coastguard Worker  'hb-kern.hh',
62*2d1272b8SAndroid Build Coastguard Worker  'hb-limits.hh',
63*2d1272b8SAndroid Build Coastguard Worker  'hb-machinery.hh',
64*2d1272b8SAndroid Build Coastguard Worker  'hb-map.cc',
65*2d1272b8SAndroid Build Coastguard Worker  'hb-map.hh',
66*2d1272b8SAndroid Build Coastguard Worker  'hb-meta.hh',
67*2d1272b8SAndroid Build Coastguard Worker  'hb-ms-feature-ranges.hh',
68*2d1272b8SAndroid Build Coastguard Worker  'hb-multimap.hh',
69*2d1272b8SAndroid Build Coastguard Worker  'hb-mutex.hh',
70*2d1272b8SAndroid Build Coastguard Worker  'hb-null.hh',
71*2d1272b8SAndroid Build Coastguard Worker  'hb-number.cc',
72*2d1272b8SAndroid Build Coastguard Worker  'hb-number.hh',
73*2d1272b8SAndroid Build Coastguard Worker  'hb-object.hh',
74*2d1272b8SAndroid Build Coastguard Worker  'hb-open-file.hh',
75*2d1272b8SAndroid Build Coastguard Worker  'hb-open-type.hh',
76*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-cff-common.hh',
77*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-cff1-std-str.hh',
78*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-cff1-table.cc',
79*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-cff1-table.hh',
80*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-cff2-table.cc',
81*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-cff2-table.hh',
82*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-cmap-table.hh',
83*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-color.cc',
84*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-face-table-list.hh',
85*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-face.cc',
86*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-face.hh',
87*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-font.cc',
88*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-gasp-table.hh',
89*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-glyf-table.hh',
90*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-hdmx-table.hh',
91*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-head-table.hh',
92*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-hhea-table.hh',
93*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-hmtx-table.hh',
94*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-kern-table.hh',
95*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-layout-base-table.hh',
96*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-layout-common.hh',
97*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-layout-gdef-table.hh',
98*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-layout-gpos-table.hh',
99*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-layout-gsub-table.hh',
100*2d1272b8SAndroid Build Coastguard Worker  'hb-outline.hh',
101*2d1272b8SAndroid Build Coastguard Worker  'hb-outline.cc',
102*2d1272b8SAndroid Build Coastguard Worker  'OT/Color/CBDT/CBDT.hh',
103*2d1272b8SAndroid Build Coastguard Worker  'OT/Color/COLR/COLR.hh',
104*2d1272b8SAndroid Build Coastguard Worker  'OT/Color/CPAL/CPAL.hh',
105*2d1272b8SAndroid Build Coastguard Worker  'OT/Color/sbix/sbix.hh',
106*2d1272b8SAndroid Build Coastguard Worker  'OT/Color/svg/svg.hh',
107*2d1272b8SAndroid Build Coastguard Worker  'OT/glyf/glyf.hh',
108*2d1272b8SAndroid Build Coastguard Worker  'OT/glyf/glyf-helpers.hh',
109*2d1272b8SAndroid Build Coastguard Worker  'OT/glyf/loca.hh',
110*2d1272b8SAndroid Build Coastguard Worker  'OT/glyf/path-builder.hh',
111*2d1272b8SAndroid Build Coastguard Worker  'OT/glyf/Glyph.hh',
112*2d1272b8SAndroid Build Coastguard Worker  'OT/glyf/GlyphHeader.hh',
113*2d1272b8SAndroid Build Coastguard Worker  'OT/glyf/SimpleGlyph.hh',
114*2d1272b8SAndroid Build Coastguard Worker  'OT/glyf/CompositeGlyph.hh',
115*2d1272b8SAndroid Build Coastguard Worker  'OT/glyf/SubsetGlyph.hh',
116*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/types.hh',
117*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/Common/Coverage.hh',
118*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/Common/CoverageFormat1.hh',
119*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/Common/CoverageFormat2.hh',
120*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/Common/RangeRecord.hh',
121*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GDEF/GDEF.hh',
122*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/AnchorFormat1.hh',
123*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/AnchorFormat2.hh',
124*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/AnchorFormat3.hh',
125*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/Anchor.hh',
126*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/AnchorMatrix.hh',
127*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/ChainContextPos.hh',
128*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/Common.hh',
129*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/ContextPos.hh',
130*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/CursivePosFormat1.hh',
131*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/CursivePos.hh',
132*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/ExtensionPos.hh',
133*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/GPOS.hh',
134*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/LigatureArray.hh',
135*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/MarkArray.hh',
136*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/MarkBasePosFormat1.hh',
137*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/MarkBasePos.hh',
138*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/MarkLigPosFormat1.hh',
139*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/MarkLigPos.hh',
140*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/MarkMarkPosFormat1.hh',
141*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/MarkMarkPos.hh',
142*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/MarkRecord.hh',
143*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/PairPosFormat1.hh',
144*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/PairPosFormat2.hh',
145*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/PairPos.hh',
146*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/PairSet.hh',
147*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/PairValueRecord.hh',
148*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/PosLookup.hh',
149*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/PosLookupSubTable.hh',
150*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/SinglePosFormat1.hh',
151*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/SinglePosFormat2.hh',
152*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/SinglePos.hh',
153*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GPOS/ValueFormat.hh',
154*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/AlternateSet.hh',
155*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/AlternateSubstFormat1.hh',
156*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/AlternateSubst.hh',
157*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/ChainContextSubst.hh',
158*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/Common.hh',
159*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/ContextSubst.hh',
160*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/ExtensionSubst.hh',
161*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/GSUB.hh',
162*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/Ligature.hh',
163*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/LigatureSet.hh',
164*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/LigatureSubstFormat1.hh',
165*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/LigatureSubst.hh',
166*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/MultipleSubstFormat1.hh',
167*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/MultipleSubst.hh',
168*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/ReverseChainSingleSubstFormat1.hh',
169*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/ReverseChainSingleSubst.hh',
170*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/Sequence.hh',
171*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/SingleSubstFormat1.hh',
172*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/SingleSubstFormat2.hh',
173*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/SingleSubst.hh',
174*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/SubstLookup.hh',
175*2d1272b8SAndroid Build Coastguard Worker  'OT/Layout/GSUB/SubstLookupSubTable.hh',
176*2d1272b8SAndroid Build Coastguard Worker  'OT/name/name.hh',
177*2d1272b8SAndroid Build Coastguard Worker  'OT/Var/VARC/coord-setter.hh',
178*2d1272b8SAndroid Build Coastguard Worker  'OT/Var/VARC/VARC.cc',
179*2d1272b8SAndroid Build Coastguard Worker  'OT/Var/VARC/VARC.hh',
180*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-layout-gsubgpos.hh',
181*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-layout-jstf-table.hh',
182*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-layout.cc',
183*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-layout.hh',
184*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-map.cc',
185*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-map.hh',
186*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-math-table.hh',
187*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-math.cc',
188*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-maxp-table.hh',
189*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-meta-table.hh',
190*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-meta.cc',
191*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-metrics.cc',
192*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-metrics.hh',
193*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-name-language-static.hh',
194*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-name-language.hh',
195*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-name-table.hh',
196*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-name.cc',
197*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-os2-table.hh',
198*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-os2-unicode-ranges.hh',
199*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-post-macroman.hh',
200*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-post-table.hh',
201*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-arabic-fallback.hh',
202*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-arabic-joining-list.hh',
203*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-arabic-pua.hh',
204*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-arabic-table.hh',
205*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-arabic-win1256.hh',
206*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-arabic.cc',
207*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-arabic.hh',
208*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-default.cc',
209*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-hangul.cc',
210*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-hebrew.cc',
211*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-indic-table.cc',
212*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-indic.cc',
213*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-indic.hh',
214*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-khmer.cc',
215*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-myanmar.cc',
216*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-syllabic.cc',
217*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-syllabic.hh',
218*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-thai.cc',
219*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-use-table.hh',
220*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-use.cc',
221*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-vowel-constraints.cc',
222*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-vowel-constraints.hh',
223*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper.hh',
224*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shape-fallback.cc',
225*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shape-fallback.hh',
226*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shape-normalize.cc',
227*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shape-normalize.hh',
228*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shape.cc',
229*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shape.hh',
230*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-stat-table.hh',
231*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-tag-table.hh',
232*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-tag.cc',
233*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-var-avar-table.hh',
234*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-var-common.hh',
235*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-var-cvar-table.hh',
236*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-var-fvar-table.hh',
237*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-var-gvar-table.hh',
238*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-var-hvar-table.hh',
239*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-var-mvar-table.hh',
240*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-var-varc-table.hh',
241*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-var.cc',
242*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-vorg-table.hh',
243*2d1272b8SAndroid Build Coastguard Worker  'hb-pool.hh',
244*2d1272b8SAndroid Build Coastguard Worker  'hb-sanitize.hh',
245*2d1272b8SAndroid Build Coastguard Worker  'hb-serialize.hh',
246*2d1272b8SAndroid Build Coastguard Worker  'hb-set-digest.hh',
247*2d1272b8SAndroid Build Coastguard Worker  'hb-set.cc',
248*2d1272b8SAndroid Build Coastguard Worker  'hb-set.hh',
249*2d1272b8SAndroid Build Coastguard Worker  'hb-shape-plan.cc',
250*2d1272b8SAndroid Build Coastguard Worker  'hb-shape-plan.hh',
251*2d1272b8SAndroid Build Coastguard Worker  'hb-shape.cc',
252*2d1272b8SAndroid Build Coastguard Worker  'hb-shaper-impl.hh',
253*2d1272b8SAndroid Build Coastguard Worker  'hb-shaper-list.hh',
254*2d1272b8SAndroid Build Coastguard Worker  'hb-shaper.cc',
255*2d1272b8SAndroid Build Coastguard Worker  'hb-shaper.hh',
256*2d1272b8SAndroid Build Coastguard Worker  'hb-static.cc',
257*2d1272b8SAndroid Build Coastguard Worker  'hb-string-array.hh',
258*2d1272b8SAndroid Build Coastguard Worker  'hb-style.cc',
259*2d1272b8SAndroid Build Coastguard Worker  'hb-ucd-table.hh',
260*2d1272b8SAndroid Build Coastguard Worker  'hb-ucd.cc',
261*2d1272b8SAndroid Build Coastguard Worker  'hb-unicode-emoji-table.hh',
262*2d1272b8SAndroid Build Coastguard Worker  'hb-unicode.cc',
263*2d1272b8SAndroid Build Coastguard Worker  'hb-unicode.hh',
264*2d1272b8SAndroid Build Coastguard Worker  'hb-utf.hh',
265*2d1272b8SAndroid Build Coastguard Worker  'hb-vector.hh',
266*2d1272b8SAndroid Build Coastguard Worker  'hb.hh',
267*2d1272b8SAndroid Build Coastguard Worker)
268*2d1272b8SAndroid Build Coastguard Worker
269*2d1272b8SAndroid Build Coastguard Workerhb_base_ragel_generated_sources = files(
270*2d1272b8SAndroid Build Coastguard Worker  'hb-buffer-deserialize-json.hh',
271*2d1272b8SAndroid Build Coastguard Worker  'hb-buffer-deserialize-text-glyphs.hh',
272*2d1272b8SAndroid Build Coastguard Worker  'hb-buffer-deserialize-text-unicode.hh',
273*2d1272b8SAndroid Build Coastguard Worker  'hb-number-parser.hh',
274*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-indic-machine.hh',
275*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-khmer-machine.hh',
276*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-myanmar-machine.hh',
277*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-use-machine.hh',
278*2d1272b8SAndroid Build Coastguard Worker)
279*2d1272b8SAndroid Build Coastguard Workerhb_base_ragel_sources = [
280*2d1272b8SAndroid Build Coastguard Worker  'hb-buffer-deserialize-json.rl',
281*2d1272b8SAndroid Build Coastguard Worker  'hb-buffer-deserialize-text-glyphs.rl',
282*2d1272b8SAndroid Build Coastguard Worker  'hb-buffer-deserialize-text-unicode.rl',
283*2d1272b8SAndroid Build Coastguard Worker  'hb-number-parser.rl',
284*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-indic-machine.rl',
285*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-khmer-machine.rl',
286*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-myanmar-machine.rl',
287*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shaper-use-machine.rl',
288*2d1272b8SAndroid Build Coastguard Worker]
289*2d1272b8SAndroid Build Coastguard Worker
290*2d1272b8SAndroid Build Coastguard Workerhb_base_headers = files(
291*2d1272b8SAndroid Build Coastguard Worker  'hb-aat-layout.h',
292*2d1272b8SAndroid Build Coastguard Worker  'hb-aat.h',
293*2d1272b8SAndroid Build Coastguard Worker  'hb-blob.h',
294*2d1272b8SAndroid Build Coastguard Worker  'hb-buffer.h',
295*2d1272b8SAndroid Build Coastguard Worker  'hb-common.h',
296*2d1272b8SAndroid Build Coastguard Worker  'hb-cplusplus.hh',
297*2d1272b8SAndroid Build Coastguard Worker  'hb-deprecated.h',
298*2d1272b8SAndroid Build Coastguard Worker  'hb-draw.h',
299*2d1272b8SAndroid Build Coastguard Worker  'hb-paint.h',
300*2d1272b8SAndroid Build Coastguard Worker  'hb-face.h',
301*2d1272b8SAndroid Build Coastguard Worker  'hb-font.h',
302*2d1272b8SAndroid Build Coastguard Worker  'hb-map.h',
303*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-color.h',
304*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-deprecated.h',
305*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-font.h',
306*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-layout.h',
307*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-math.h',
308*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-meta.h',
309*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-metrics.h',
310*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-name.h',
311*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-shape.h',
312*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-var.h',
313*2d1272b8SAndroid Build Coastguard Worker  'hb-ot.h',
314*2d1272b8SAndroid Build Coastguard Worker  'hb-set.h',
315*2d1272b8SAndroid Build Coastguard Worker  'hb-shape-plan.h',
316*2d1272b8SAndroid Build Coastguard Worker  'hb-shape.h',
317*2d1272b8SAndroid Build Coastguard Worker  'hb-style.h',
318*2d1272b8SAndroid Build Coastguard Worker  'hb-unicode.h',
319*2d1272b8SAndroid Build Coastguard Worker  'hb.h',
320*2d1272b8SAndroid Build Coastguard Worker)
321*2d1272b8SAndroid Build Coastguard Workerhb_base_headers += hb_version_h
322*2d1272b8SAndroid Build Coastguard Worker
323*2d1272b8SAndroid Build Coastguard Worker# Optional Sources and Headers with external deps
324*2d1272b8SAndroid Build Coastguard Worker
325*2d1272b8SAndroid Build Coastguard Workerhb_ft_sources = files('hb-ft.cc', 'hb-ft-colr.hh')
326*2d1272b8SAndroid Build Coastguard Workerhb_ft_headers = files('hb-ft.h')
327*2d1272b8SAndroid Build Coastguard Worker
328*2d1272b8SAndroid Build Coastguard Workerhb_glib_sources = files('hb-glib.cc')
329*2d1272b8SAndroid Build Coastguard Workerhb_glib_headers = files('hb-glib.h')
330*2d1272b8SAndroid Build Coastguard Worker
331*2d1272b8SAndroid Build Coastguard Workerhb_graphite2_sources = files('hb-graphite2.cc')
332*2d1272b8SAndroid Build Coastguard Workerhb_graphite2_headers = files('hb-graphite2.h')
333*2d1272b8SAndroid Build Coastguard Worker
334*2d1272b8SAndroid Build Coastguard Workerhb_wasm_sources = files(
335*2d1272b8SAndroid Build Coastguard Worker  'hb-wasm-api.cc',
336*2d1272b8SAndroid Build Coastguard Worker  'hb-wasm-api.hh',
337*2d1272b8SAndroid Build Coastguard Worker  'hb-wasm-api-blob.hh',
338*2d1272b8SAndroid Build Coastguard Worker  'hb-wasm-api-buffer.hh',
339*2d1272b8SAndroid Build Coastguard Worker  'hb-wasm-api-common.hh',
340*2d1272b8SAndroid Build Coastguard Worker  'hb-wasm-api-face.hh',
341*2d1272b8SAndroid Build Coastguard Worker  'hb-wasm-api-font.hh',
342*2d1272b8SAndroid Build Coastguard Worker  'hb-wasm-api-shape.hh',
343*2d1272b8SAndroid Build Coastguard Worker  'hb-wasm-shape.cc',
344*2d1272b8SAndroid Build Coastguard Worker)
345*2d1272b8SAndroid Build Coastguard Workerhb_wasm_headers = files()
346*2d1272b8SAndroid Build Coastguard Worker
347*2d1272b8SAndroid Build Coastguard Worker# System-dependent sources and headers
348*2d1272b8SAndroid Build Coastguard Worker
349*2d1272b8SAndroid Build Coastguard Workerhb_coretext_sources = files('hb-coretext-shape.cc', 'hb-coretext-font.cc')
350*2d1272b8SAndroid Build Coastguard Workerhb_coretext_headers = files('hb-coretext.h')
351*2d1272b8SAndroid Build Coastguard Worker
352*2d1272b8SAndroid Build Coastguard Workerhb_directwrite_sources = files('hb-directwrite.cc')
353*2d1272b8SAndroid Build Coastguard Workerhb_directwrite_headers = files('hb-directwrite.h')
354*2d1272b8SAndroid Build Coastguard Worker
355*2d1272b8SAndroid Build Coastguard Workerhb_gdi_sources = files('hb-gdi.cc')
356*2d1272b8SAndroid Build Coastguard Workerhb_gdi_headers = files('hb-gdi.h')
357*2d1272b8SAndroid Build Coastguard Worker
358*2d1272b8SAndroid Build Coastguard Workerhb_uniscribe_sources = files('hb-uniscribe.cc')
359*2d1272b8SAndroid Build Coastguard Workerhb_uniscribe_headers = files('hb-uniscribe.h')
360*2d1272b8SAndroid Build Coastguard Worker
361*2d1272b8SAndroid Build Coastguard Worker# Sources for libharfbuzz-gobject and libharfbuzz-icu
362*2d1272b8SAndroid Build Coastguard Workerhb_icu_sources = files('hb-icu.cc')
363*2d1272b8SAndroid Build Coastguard Workerhb_icu_headers = files('hb-icu.h')
364*2d1272b8SAndroid Build Coastguard Worker
365*2d1272b8SAndroid Build Coastguard Worker# Sources for libharfbuzz-subset
366*2d1272b8SAndroid Build Coastguard Workerhb_subset_sources = files(
367*2d1272b8SAndroid Build Coastguard Worker  'hb-number.cc',
368*2d1272b8SAndroid Build Coastguard Worker  'hb-number.hh',
369*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-cff1-table.cc',
370*2d1272b8SAndroid Build Coastguard Worker  'hb-ot-cff2-table.cc',
371*2d1272b8SAndroid Build Coastguard Worker  'hb-static.cc',
372*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-accelerator.hh',
373*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-cff-common.cc',
374*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-cff-common.hh',
375*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-cff1.cc',
376*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-cff2.cc',
377*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-input.cc',
378*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-input.hh',
379*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-instancer-iup.hh',
380*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-instancer-iup.cc',
381*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-instancer-solver.hh',
382*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-instancer-solver.cc',
383*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-plan.cc',
384*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-plan.hh',
385*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-plan-member-list.hh',
386*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-repacker.cc',
387*2d1272b8SAndroid Build Coastguard Worker  'graph/gsubgpos-context.cc',
388*2d1272b8SAndroid Build Coastguard Worker  'graph/gsubgpos-context.hh',
389*2d1272b8SAndroid Build Coastguard Worker  'graph/gsubgpos-graph.hh',
390*2d1272b8SAndroid Build Coastguard Worker  'graph/pairpos-graph.hh',
391*2d1272b8SAndroid Build Coastguard Worker  'graph/markbasepos-graph.hh',
392*2d1272b8SAndroid Build Coastguard Worker  'graph/coverage-graph.hh',
393*2d1272b8SAndroid Build Coastguard Worker  'graph/classdef-graph.hh',
394*2d1272b8SAndroid Build Coastguard Worker  'graph/split-helpers.hh',
395*2d1272b8SAndroid Build Coastguard Worker  'hb-subset.cc',
396*2d1272b8SAndroid Build Coastguard Worker  'hb-subset.hh',
397*2d1272b8SAndroid Build Coastguard Worker)
398*2d1272b8SAndroid Build Coastguard Worker
399*2d1272b8SAndroid Build Coastguard Workerhb_subset_headers = files(
400*2d1272b8SAndroid Build Coastguard Worker  'hb-subset.h',
401*2d1272b8SAndroid Build Coastguard Worker  'hb-subset-repacker.h'
402*2d1272b8SAndroid Build Coastguard Worker)
403*2d1272b8SAndroid Build Coastguard Worker
404*2d1272b8SAndroid Build Coastguard Workerhb_gobject_sources = files(
405*2d1272b8SAndroid Build Coastguard Worker  'hb-gobject-structs.cc'
406*2d1272b8SAndroid Build Coastguard Worker)
407*2d1272b8SAndroid Build Coastguard Worker
408*2d1272b8SAndroid Build Coastguard Workerhb_gobject_headers = files(
409*2d1272b8SAndroid Build Coastguard Worker  'hb-gobject.h',
410*2d1272b8SAndroid Build Coastguard Worker  'hb-gobject-structs.h',
411*2d1272b8SAndroid Build Coastguard Worker)
412*2d1272b8SAndroid Build Coastguard Worker
413*2d1272b8SAndroid Build Coastguard Workerragel = find_program('ragel', version: '6.10', required: false)
414*2d1272b8SAndroid Build Coastguard Workerhas_ragel = ragel.found()
415*2d1272b8SAndroid Build Coastguard Workerif not has_ragel and get_option('ragel_subproject')
416*2d1272b8SAndroid Build Coastguard Worker    ragel = subproject('ragel').get_variable('ragel')
417*2d1272b8SAndroid Build Coastguard Worker    has_ragel = true
418*2d1272b8SAndroid Build Coastguard Workerendif
419*2d1272b8SAndroid Build Coastguard Workerif not has_ragel
420*2d1272b8SAndroid Build Coastguard Worker  if not meson.is_subproject()
421*2d1272b8SAndroid Build Coastguard Worker    warning('You have to install ragel if you are going to develop HarfBuzz itself')
422*2d1272b8SAndroid Build Coastguard Worker  endif
423*2d1272b8SAndroid Build Coastguard Workerelse
424*2d1272b8SAndroid Build Coastguard Worker  ragel_helper = find_program('gen-ragel-artifacts.py')
425*2d1272b8SAndroid Build Coastguard Worker  foreach rl : hb_base_ragel_sources
426*2d1272b8SAndroid Build Coastguard Worker    hh = rl.split('.')[0] + '.hh'
427*2d1272b8SAndroid Build Coastguard Worker    custom_target('@0@'.format(hh),
428*2d1272b8SAndroid Build Coastguard Worker      build_by_default: true,
429*2d1272b8SAndroid Build Coastguard Worker      input: rl,
430*2d1272b8SAndroid Build Coastguard Worker      output: hh,
431*2d1272b8SAndroid Build Coastguard Worker      command: [ragel_helper, ragel, '@OUTPUT@', meson.current_source_dir(), '@INPUT@'],
432*2d1272b8SAndroid Build Coastguard Worker    )
433*2d1272b8SAndroid Build Coastguard Worker  endforeach
434*2d1272b8SAndroid Build Coastguard Workerendif
435*2d1272b8SAndroid Build Coastguard Worker
436*2d1272b8SAndroid Build Coastguard Workercustom_target('harfbuzz.cc',
437*2d1272b8SAndroid Build Coastguard Worker  build_by_default: true,
438*2d1272b8SAndroid Build Coastguard Worker  output: 'harfbuzz.cc',
439*2d1272b8SAndroid Build Coastguard Worker  input: hb_base_sources + hb_glib_sources + hb_ft_sources +
440*2d1272b8SAndroid Build Coastguard Worker         hb_graphite2_sources + hb_uniscribe_sources + hb_gdi_sources +
441*2d1272b8SAndroid Build Coastguard Worker         hb_directwrite_sources + hb_coretext_sources + hb_wasm_sources,
442*2d1272b8SAndroid Build Coastguard Worker  command: [find_program('gen-harfbuzzcc.py'),
443*2d1272b8SAndroid Build Coastguard Worker            '@OUTPUT@', meson.current_source_dir(), '@INPUT@'],
444*2d1272b8SAndroid Build Coastguard Worker)
445*2d1272b8SAndroid Build Coastguard Worker
446*2d1272b8SAndroid Build Coastguard Workerincsrc = include_directories('.')
447*2d1272b8SAndroid Build Coastguard Worker
448*2d1272b8SAndroid Build Coastguard Workerhb_sources = hb_base_sources + hb_base_ragel_generated_sources
449*2d1272b8SAndroid Build Coastguard Workerhb_headers = hb_base_headers
450*2d1272b8SAndroid Build Coastguard Worker
451*2d1272b8SAndroid Build Coastguard Workerharfbuzz_deps = [thread_dep, m_dep] + harfbuzz_extra_deps
452*2d1272b8SAndroid Build Coastguard Worker
453*2d1272b8SAndroid Build Coastguard Workerif get_option('with_libstdcxx')
454*2d1272b8SAndroid Build Coastguard Worker  chosen_linker = 'cpp'
455*2d1272b8SAndroid Build Coastguard Workerelse
456*2d1272b8SAndroid Build Coastguard Worker  # Use a C linker, not C++; Don't link to libstdc++
457*2d1272b8SAndroid Build Coastguard Worker  chosen_linker = 'c'
458*2d1272b8SAndroid Build Coastguard Workerendif
459*2d1272b8SAndroid Build Coastguard Workerlibharfbuzz_link_language = chosen_linker
460*2d1272b8SAndroid Build Coastguard Worker
461*2d1272b8SAndroid Build Coastguard Workerif conf.get('HAVE_FREETYPE', 0) == 1
462*2d1272b8SAndroid Build Coastguard Worker  hb_sources += hb_ft_sources
463*2d1272b8SAndroid Build Coastguard Worker  hb_headers += hb_ft_headers
464*2d1272b8SAndroid Build Coastguard Worker  harfbuzz_deps += [freetype_dep]
465*2d1272b8SAndroid Build Coastguard Workerendif
466*2d1272b8SAndroid Build Coastguard Worker
467*2d1272b8SAndroid Build Coastguard Workerif conf.get('HAVE_GLIB', 0) == 1
468*2d1272b8SAndroid Build Coastguard Worker  hb_sources += hb_glib_sources
469*2d1272b8SAndroid Build Coastguard Worker  hb_headers += hb_glib_headers
470*2d1272b8SAndroid Build Coastguard Worker  harfbuzz_deps += [glib_dep]
471*2d1272b8SAndroid Build Coastguard Workerendif
472*2d1272b8SAndroid Build Coastguard Worker
473*2d1272b8SAndroid Build Coastguard Worker# We set those here to not include the sources below that are of no use to
474*2d1272b8SAndroid Build Coastguard Worker# GObject Introspection
475*2d1272b8SAndroid Build Coastguard Workergir_sources = hb_sources + hb_gobject_sources
476*2d1272b8SAndroid Build Coastguard Workergir_headers = hb_headers + hb_gobject_headers
477*2d1272b8SAndroid Build Coastguard Worker
478*2d1272b8SAndroid Build Coastguard Workerif conf.get('HAVE_GDI', 0) == 1
479*2d1272b8SAndroid Build Coastguard Worker  hb_sources += hb_gdi_sources
480*2d1272b8SAndroid Build Coastguard Worker  hb_headers += hb_gdi_headers
481*2d1272b8SAndroid Build Coastguard Worker  harfbuzz_deps += gdi_uniscribe_deps
482*2d1272b8SAndroid Build Coastguard Workerendif
483*2d1272b8SAndroid Build Coastguard Worker
484*2d1272b8SAndroid Build Coastguard Workerif conf.get('HAVE_GRAPHITE2', 0) == 1
485*2d1272b8SAndroid Build Coastguard Worker  hb_sources += hb_graphite2_sources
486*2d1272b8SAndroid Build Coastguard Worker  hb_headers += hb_graphite2_headers
487*2d1272b8SAndroid Build Coastguard Worker  harfbuzz_deps += [graphite2_dep, graphite_dep]
488*2d1272b8SAndroid Build Coastguard Workerendif
489*2d1272b8SAndroid Build Coastguard Worker
490*2d1272b8SAndroid Build Coastguard Workerif conf.get('HAVE_WASM', 0) == 1
491*2d1272b8SAndroid Build Coastguard Worker  hb_sources += hb_wasm_sources
492*2d1272b8SAndroid Build Coastguard Worker  hb_headers += hb_wasm_headers
493*2d1272b8SAndroid Build Coastguard Worker  harfbuzz_deps += wasm_dep
494*2d1272b8SAndroid Build Coastguard Worker  #harfbuzz_deps += llvm_dep
495*2d1272b8SAndroid Build Coastguard Workerendif
496*2d1272b8SAndroid Build Coastguard Worker
497*2d1272b8SAndroid Build Coastguard Workerif conf.get('HAVE_UNISCRIBE', 0) == 1
498*2d1272b8SAndroid Build Coastguard Worker  hb_sources += hb_uniscribe_sources
499*2d1272b8SAndroid Build Coastguard Worker  hb_headers += hb_uniscribe_headers
500*2d1272b8SAndroid Build Coastguard Workerendif
501*2d1272b8SAndroid Build Coastguard Worker
502*2d1272b8SAndroid Build Coastguard Workerif conf.get('HAVE_DIRECTWRITE', 0) == 1
503*2d1272b8SAndroid Build Coastguard Worker  hb_sources += hb_directwrite_sources
504*2d1272b8SAndroid Build Coastguard Worker  hb_headers += hb_directwrite_headers
505*2d1272b8SAndroid Build Coastguard Worker  # hb-directwrite needs a C++ linker
506*2d1272b8SAndroid Build Coastguard Worker  libharfbuzz_link_language = 'cpp'
507*2d1272b8SAndroid Build Coastguard Workerendif
508*2d1272b8SAndroid Build Coastguard Worker
509*2d1272b8SAndroid Build Coastguard Workerif conf.get('HAVE_CORETEXT', 0) == 1
510*2d1272b8SAndroid Build Coastguard Worker  hb_sources += hb_coretext_sources
511*2d1272b8SAndroid Build Coastguard Worker  hb_headers += hb_coretext_headers
512*2d1272b8SAndroid Build Coastguard Worker  harfbuzz_deps += coretext_deps
513*2d1272b8SAndroid Build Coastguard Workerendif
514*2d1272b8SAndroid Build Coastguard Worker
515*2d1272b8SAndroid Build Coastguard Workerhave_icu = conf.get('HAVE_ICU', 0) == 1
516*2d1272b8SAndroid Build Coastguard Workerhave_icu_builtin = conf.get('HAVE_ICU_BUILTIN', 0) == 1
517*2d1272b8SAndroid Build Coastguard Workerif have_icu and have_icu_builtin
518*2d1272b8SAndroid Build Coastguard Worker  hb_sources += hb_icu_sources
519*2d1272b8SAndroid Build Coastguard Worker  hb_headers += hb_icu_headers
520*2d1272b8SAndroid Build Coastguard Worker  harfbuzz_deps += [icu_dep]
521*2d1272b8SAndroid Build Coastguard Workerendif
522*2d1272b8SAndroid Build Coastguard Worker
523*2d1272b8SAndroid Build Coastguard Workerfeatures = [
524*2d1272b8SAndroid Build Coastguard Worker  'CAIRO',
525*2d1272b8SAndroid Build Coastguard Worker  'CORETEXT',
526*2d1272b8SAndroid Build Coastguard Worker  'DIRECTWRITE',
527*2d1272b8SAndroid Build Coastguard Worker  'FREETYPE',
528*2d1272b8SAndroid Build Coastguard Worker  'GDI',
529*2d1272b8SAndroid Build Coastguard Worker  'GLIB',
530*2d1272b8SAndroid Build Coastguard Worker  'GOBJECT',
531*2d1272b8SAndroid Build Coastguard Worker  'GRAPHITE',
532*2d1272b8SAndroid Build Coastguard Worker  'ICU',
533*2d1272b8SAndroid Build Coastguard Worker  'UNISCRIBE',
534*2d1272b8SAndroid Build Coastguard Worker  'WASM',
535*2d1272b8SAndroid Build Coastguard Worker]
536*2d1272b8SAndroid Build Coastguard Worker
537*2d1272b8SAndroid Build Coastguard Workerhb_enabled_features = configuration_data()
538*2d1272b8SAndroid Build Coastguard Workerhb_supported_features = configuration_data()
539*2d1272b8SAndroid Build Coastguard Workerforeach feature : features
540*2d1272b8SAndroid Build Coastguard Worker  key = 'HB_HAS_@0@'.format(feature)
541*2d1272b8SAndroid Build Coastguard Worker  hb_enabled_features.set(key, conf.get('HAVE_@0@'.format(feature), false))
542*2d1272b8SAndroid Build Coastguard Worker  hb_supported_features.set(key, 1)
543*2d1272b8SAndroid Build Coastguard Workerendforeach
544*2d1272b8SAndroid Build Coastguard Worker
545*2d1272b8SAndroid Build Coastguard Worker# The enabled features. This file is installed.
546*2d1272b8SAndroid Build Coastguard Workerhb_features_h = configure_file(input: 'hb-features.h.in',
547*2d1272b8SAndroid Build Coastguard Worker                               output: 'hb-features.h',
548*2d1272b8SAndroid Build Coastguard Worker                               configuration: hb_enabled_features,
549*2d1272b8SAndroid Build Coastguard Worker                               install: true,
550*2d1272b8SAndroid Build Coastguard Worker                               install_dir: get_option('includedir') / meson.project_name())
551*2d1272b8SAndroid Build Coastguard Worker
552*2d1272b8SAndroid Build Coastguard Worker# This file is generated to convince gtk-doc to generate documentation for all
553*2d1272b8SAndroid Build Coastguard Worker# HB_HAS_* macros, whether they are enabled for the current build or not.
554*2d1272b8SAndroid Build Coastguard Worker# This file should not be installed.
555*2d1272b8SAndroid Build Coastguard Workerhb_supported_features_h = configure_file(input: 'hb-features.h.in',
556*2d1272b8SAndroid Build Coastguard Worker                               output: 'hb-supported-features.h',
557*2d1272b8SAndroid Build Coastguard Worker                               configuration: hb_supported_features,
558*2d1272b8SAndroid Build Coastguard Worker                               install: false)
559*2d1272b8SAndroid Build Coastguard Worker
560*2d1272b8SAndroid Build Coastguard Worker
561*2d1272b8SAndroid Build Coastguard Worker# Base and default-included sources and headers
562*2d1272b8SAndroid Build Coastguard Workergen_def = find_program('gen-def.py')
563*2d1272b8SAndroid Build Coastguard Workergen_def_cmd = [gen_def, '@OUTPUT@', '@INPUT@']
564*2d1272b8SAndroid Build Coastguard Workerif get_option('experimental_api')
565*2d1272b8SAndroid Build Coastguard Worker  gen_def_cmd += '--experimental-api'
566*2d1272b8SAndroid Build Coastguard Workerendif
567*2d1272b8SAndroid Build Coastguard Worker
568*2d1272b8SAndroid Build Coastguard Worker# harfbuzz
569*2d1272b8SAndroid Build Coastguard Workerharfbuzz_def = custom_target('harfbuzz.def',
570*2d1272b8SAndroid Build Coastguard Worker    command: gen_def_cmd,
571*2d1272b8SAndroid Build Coastguard Worker    input: hb_headers,
572*2d1272b8SAndroid Build Coastguard Worker    output: 'harfbuzz.def')
573*2d1272b8SAndroid Build Coastguard Workerdefs_list = [harfbuzz_def]
574*2d1272b8SAndroid Build Coastguard Worker
575*2d1272b8SAndroid Build Coastguard Workerversion = '0.@[email protected]'.format(hb_version_int)
576*2d1272b8SAndroid Build Coastguard Worker
577*2d1272b8SAndroid Build Coastguard Workerextra_hb_cpp_args = []
578*2d1272b8SAndroid Build Coastguard Workerif cpp.get_define('_MSC_FULL_VER') != ''
579*2d1272b8SAndroid Build Coastguard Worker  if get_option('default_library') != 'static'
580*2d1272b8SAndroid Build Coastguard Worker    extra_hb_cpp_args += '-DHB_DLL_EXPORT'
581*2d1272b8SAndroid Build Coastguard Worker  endif
582*2d1272b8SAndroid Build Coastguard Worker  hb_so_version = ''
583*2d1272b8SAndroid Build Coastguard Workerelse
584*2d1272b8SAndroid Build Coastguard Worker  hb_so_version = '0'
585*2d1272b8SAndroid Build Coastguard Workerendif
586*2d1272b8SAndroid Build Coastguard Worker
587*2d1272b8SAndroid Build Coastguard Workerif get_option('fuzzer_ldflags') != ''
588*2d1272b8SAndroid Build Coastguard Worker  extra_hb_cpp_args += ['-DHB_CUSTOM_MALLOC']
589*2d1272b8SAndroid Build Coastguard Worker  hb_sources += 'failing-alloc.c'
590*2d1272b8SAndroid Build Coastguard Worker  hb_subset_sources += 'failing-alloc.c'
591*2d1272b8SAndroid Build Coastguard Worker  hb_icu_sources += 'failing-alloc.c'
592*2d1272b8SAndroid Build Coastguard Worker  hb_gobject_sources += 'failing-alloc.c'
593*2d1272b8SAndroid Build Coastguard Workerendif
594*2d1272b8SAndroid Build Coastguard Worker
595*2d1272b8SAndroid Build Coastguard Workerdarwin_versions = [hb_version_int, '@[email protected]'.format(hb_version_int)]
596*2d1272b8SAndroid Build Coastguard Worker
597*2d1272b8SAndroid Build Coastguard Workerlibharfbuzz = library('harfbuzz', hb_sources,
598*2d1272b8SAndroid Build Coastguard Worker  include_directories: incconfig,
599*2d1272b8SAndroid Build Coastguard Worker  dependencies: harfbuzz_deps,
600*2d1272b8SAndroid Build Coastguard Worker  cpp_args: cpp_args + extra_hb_cpp_args,
601*2d1272b8SAndroid Build Coastguard Worker  soversion: hb_so_version,
602*2d1272b8SAndroid Build Coastguard Worker  version: version,
603*2d1272b8SAndroid Build Coastguard Worker  install: true,
604*2d1272b8SAndroid Build Coastguard Worker  darwin_versions: darwin_versions,
605*2d1272b8SAndroid Build Coastguard Worker  link_language: libharfbuzz_link_language,
606*2d1272b8SAndroid Build Coastguard Worker)
607*2d1272b8SAndroid Build Coastguard Worker
608*2d1272b8SAndroid Build Coastguard Workerlibharfbuzz_dep = declare_dependency(
609*2d1272b8SAndroid Build Coastguard Worker  link_with: libharfbuzz,
610*2d1272b8SAndroid Build Coastguard Worker  include_directories: incsrc,
611*2d1272b8SAndroid Build Coastguard Worker  dependencies: harfbuzz_deps)
612*2d1272b8SAndroid Build Coastguard Workermeson.override_dependency('harfbuzz', libharfbuzz_dep)
613*2d1272b8SAndroid Build Coastguard Worker
614*2d1272b8SAndroid Build Coastguard Worker# harfbuzz-subset
615*2d1272b8SAndroid Build Coastguard Workerharfbuzz_subset_def = custom_target('harfbuzz-subset.def',
616*2d1272b8SAndroid Build Coastguard Worker    command: gen_def_cmd,
617*2d1272b8SAndroid Build Coastguard Worker    input: hb_subset_headers,
618*2d1272b8SAndroid Build Coastguard Worker    output: 'harfbuzz-subset.def')
619*2d1272b8SAndroid Build Coastguard Workerdefs_list += [harfbuzz_subset_def]
620*2d1272b8SAndroid Build Coastguard Worker
621*2d1272b8SAndroid Build Coastguard Workerlibharfbuzz_subset = library('harfbuzz-subset', hb_subset_sources,
622*2d1272b8SAndroid Build Coastguard Worker  include_directories: incconfig,
623*2d1272b8SAndroid Build Coastguard Worker  dependencies: [m_dep],
624*2d1272b8SAndroid Build Coastguard Worker  link_with: [libharfbuzz],
625*2d1272b8SAndroid Build Coastguard Worker  cpp_args: cpp_args + extra_hb_cpp_args,
626*2d1272b8SAndroid Build Coastguard Worker  soversion: hb_so_version,
627*2d1272b8SAndroid Build Coastguard Worker  version: version,
628*2d1272b8SAndroid Build Coastguard Worker  install: true,
629*2d1272b8SAndroid Build Coastguard Worker  darwin_versions: darwin_versions,
630*2d1272b8SAndroid Build Coastguard Worker  link_language: chosen_linker,
631*2d1272b8SAndroid Build Coastguard Worker)
632*2d1272b8SAndroid Build Coastguard Worker
633*2d1272b8SAndroid Build Coastguard Workercustom_target('harfbuzz-subset.cc',
634*2d1272b8SAndroid Build Coastguard Worker  build_by_default: true,
635*2d1272b8SAndroid Build Coastguard Worker  output: 'harfbuzz-subset.cc',
636*2d1272b8SAndroid Build Coastguard Worker  input: hb_base_sources + hb_subset_sources,
637*2d1272b8SAndroid Build Coastguard Worker  command: [find_program('gen-harfbuzzcc.py'),
638*2d1272b8SAndroid Build Coastguard Worker            '@OUTPUT@', meson.current_source_dir(), '@INPUT@'],
639*2d1272b8SAndroid Build Coastguard Worker)
640*2d1272b8SAndroid Build Coastguard Worker
641*2d1272b8SAndroid Build Coastguard Workerlibharfbuzz_subset_dep = declare_dependency(
642*2d1272b8SAndroid Build Coastguard Worker  link_with: libharfbuzz_subset,
643*2d1272b8SAndroid Build Coastguard Worker  include_directories: incsrc,
644*2d1272b8SAndroid Build Coastguard Worker  dependencies: [m_dep])
645*2d1272b8SAndroid Build Coastguard Workermeson.override_dependency('harfbuzz-subset', libharfbuzz_subset_dep)
646*2d1272b8SAndroid Build Coastguard Worker
647*2d1272b8SAndroid Build Coastguard Workerlibharfbuzz_cairo_dep = null_dep
648*2d1272b8SAndroid Build Coastguard Workerif conf.get('HAVE_CAIRO', 0) == 1
649*2d1272b8SAndroid Build Coastguard Worker  hb_cairo_sources = [
650*2d1272b8SAndroid Build Coastguard Worker    'hb-cairo.cc',
651*2d1272b8SAndroid Build Coastguard Worker    'hb-cairo-utils.cc',
652*2d1272b8SAndroid Build Coastguard Worker    'hb-static.cc'
653*2d1272b8SAndroid Build Coastguard Worker  ]
654*2d1272b8SAndroid Build Coastguard Worker
655*2d1272b8SAndroid Build Coastguard Worker  hb_cairo_headers = [
656*2d1272b8SAndroid Build Coastguard Worker    'hb-cairo.h',
657*2d1272b8SAndroid Build Coastguard Worker  ]
658*2d1272b8SAndroid Build Coastguard Worker
659*2d1272b8SAndroid Build Coastguard Worker  cairo_dep = dependency('cairo')
660*2d1272b8SAndroid Build Coastguard Worker
661*2d1272b8SAndroid Build Coastguard Worker  libharfbuzz_cairo = library('harfbuzz-cairo', hb_cairo_sources,
662*2d1272b8SAndroid Build Coastguard Worker    include_directories: incconfig,
663*2d1272b8SAndroid Build Coastguard Worker    dependencies: [m_dep, cairo_dep],
664*2d1272b8SAndroid Build Coastguard Worker    link_with: [libharfbuzz],
665*2d1272b8SAndroid Build Coastguard Worker     cpp_args: cpp_args + extra_hb_cpp_args,
666*2d1272b8SAndroid Build Coastguard Worker    soversion: hb_so_version,
667*2d1272b8SAndroid Build Coastguard Worker    version: version,
668*2d1272b8SAndroid Build Coastguard Worker    install: true,
669*2d1272b8SAndroid Build Coastguard Worker    darwin_versions: darwin_versions,
670*2d1272b8SAndroid Build Coastguard Worker    link_language: chosen_linker,
671*2d1272b8SAndroid Build Coastguard Worker  )
672*2d1272b8SAndroid Build Coastguard Worker
673*2d1272b8SAndroid Build Coastguard Worker  install_headers(hb_cairo_headers, subdir: meson.project_name())
674*2d1272b8SAndroid Build Coastguard Worker
675*2d1272b8SAndroid Build Coastguard Worker  libharfbuzz_cairo_dep = declare_dependency(
676*2d1272b8SAndroid Build Coastguard Worker    link_with: libharfbuzz_cairo,
677*2d1272b8SAndroid Build Coastguard Worker    include_directories: incsrc,
678*2d1272b8SAndroid Build Coastguard Worker    dependencies: [m_dep, cairo_dep])
679*2d1272b8SAndroid Build Coastguard Worker  meson.override_dependency('harfbuzz-cairo', libharfbuzz_cairo_dep)
680*2d1272b8SAndroid Build Coastguard Worker
681*2d1272b8SAndroid Build Coastguard Worker  harfbuzz_cairo_def = custom_target('harfbuzz-cairo.def',
682*2d1272b8SAndroid Build Coastguard Worker    command: gen_def_cmd,
683*2d1272b8SAndroid Build Coastguard Worker    input: hb_cairo_headers,
684*2d1272b8SAndroid Build Coastguard Worker    output: 'harfbuzz-cairo.def')
685*2d1272b8SAndroid Build Coastguard Worker  defs_list += [harfbuzz_cairo_def]
686*2d1272b8SAndroid Build Coastguard Worker
687*2d1272b8SAndroid Build Coastguard Worker  pkgmod.generate(libharfbuzz_cairo,
688*2d1272b8SAndroid Build Coastguard Worker    description: 'HarfBuzz cairo support',
689*2d1272b8SAndroid Build Coastguard Worker    requires: ['harfbuzz = @0@'.format(meson.project_version())],
690*2d1272b8SAndroid Build Coastguard Worker    subdirs: [meson.project_name()],
691*2d1272b8SAndroid Build Coastguard Worker    version: meson.project_version(),
692*2d1272b8SAndroid Build Coastguard Worker  )
693*2d1272b8SAndroid Build Coastguard Workerendif
694*2d1272b8SAndroid Build Coastguard Worker
695*2d1272b8SAndroid Build Coastguard Workerif get_option('tests').enabled()
696*2d1272b8SAndroid Build Coastguard Worker  # TODO: Microsoft LINK gives the following because extern, non dllexport
697*2d1272b8SAndroid Build Coastguard Worker  # symbols can only be used when linking against a static library
698*2d1272b8SAndroid Build Coastguard Worker  # error LNK2019: unresolved external symbol "unsigned __int64 const * const _hb_NullPool"
699*2d1272b8SAndroid Build Coastguard Worker  if cpp.get_define('_MSC_FULL_VER') == ''
700*2d1272b8SAndroid Build Coastguard Worker    noinst_programs = {
701*2d1272b8SAndroid Build Coastguard Worker      'main': 'main.cc',
702*2d1272b8SAndroid Build Coastguard Worker      'test-basics': 'test.cc',
703*2d1272b8SAndroid Build Coastguard Worker      'test-buffer-serialize': 'test-buffer-serialize.cc',
704*2d1272b8SAndroid Build Coastguard Worker      'test-ot-meta': 'test-ot-meta.cc',
705*2d1272b8SAndroid Build Coastguard Worker      'test-ot-name': 'test-ot-name.cc',
706*2d1272b8SAndroid Build Coastguard Worker      'test-ot-glyphname': 'test-ot-glyphname.cc',
707*2d1272b8SAndroid Build Coastguard Worker      'test-ot-gpos-size-params': 'test-gpos-size-params.cc',
708*2d1272b8SAndroid Build Coastguard Worker      'test-ot-gsub-get-alternates': 'test-gsub-get-alternates.cc',
709*2d1272b8SAndroid Build Coastguard Worker      'test-ot-gsub-would-substitute': 'test-gsub-would-substitute.cc',
710*2d1272b8SAndroid Build Coastguard Worker      'test-use-table': 'test-use-table.cc',
711*2d1272b8SAndroid Build Coastguard Worker    }
712*2d1272b8SAndroid Build Coastguard Worker    foreach name, source : noinst_programs
713*2d1272b8SAndroid Build Coastguard Worker      executable(name, source,
714*2d1272b8SAndroid Build Coastguard Worker        include_directories: incconfig,
715*2d1272b8SAndroid Build Coastguard Worker        cpp_args: cpp_args + ['-UNDEBUG'],
716*2d1272b8SAndroid Build Coastguard Worker        dependencies: libharfbuzz_dep,
717*2d1272b8SAndroid Build Coastguard Worker        install: false,
718*2d1272b8SAndroid Build Coastguard Worker      )
719*2d1272b8SAndroid Build Coastguard Worker    endforeach
720*2d1272b8SAndroid Build Coastguard Worker  endif
721*2d1272b8SAndroid Build Coastguard Worker
722*2d1272b8SAndroid Build Coastguard Worker  compiled_tests = {
723*2d1272b8SAndroid Build Coastguard Worker    'test-algs': ['test-algs.cc', 'hb-static.cc'],
724*2d1272b8SAndroid Build Coastguard Worker    'test-array': ['test-array.cc'],
725*2d1272b8SAndroid Build Coastguard Worker    'test-bimap': ['test-bimap.cc', 'hb-static.cc'],
726*2d1272b8SAndroid Build Coastguard Worker    'test-cff': ['test-cff.cc', 'hb-static.cc'],
727*2d1272b8SAndroid Build Coastguard Worker    'test-classdef-graph': ['graph/test-classdef-graph.cc', 'hb-static.cc', 'graph/gsubgpos-context.cc'],
728*2d1272b8SAndroid Build Coastguard Worker    'test-iter': ['test-iter.cc', 'hb-static.cc'],
729*2d1272b8SAndroid Build Coastguard Worker    'test-machinery': ['test-machinery.cc', 'hb-static.cc'],
730*2d1272b8SAndroid Build Coastguard Worker    'test-map': ['test-map.cc', 'hb-static.cc'],
731*2d1272b8SAndroid Build Coastguard Worker    'test-multimap': ['test-multimap.cc', 'hb-static.cc'],
732*2d1272b8SAndroid Build Coastguard Worker    'test-number': ['test-number.cc', 'hb-number.cc'],
733*2d1272b8SAndroid Build Coastguard Worker    'test-ot-tag': ['hb-ot-tag.cc'],
734*2d1272b8SAndroid Build Coastguard Worker    'test-set': ['test-set.cc', 'hb-static.cc'],
735*2d1272b8SAndroid Build Coastguard Worker    'test-serialize': ['test-serialize.cc', 'hb-static.cc'],
736*2d1272b8SAndroid Build Coastguard Worker    'test-vector': ['test-vector.cc', 'hb-static.cc'],
737*2d1272b8SAndroid Build Coastguard Worker    'test-repacker': ['test-repacker.cc', 'hb-static.cc', 'graph/gsubgpos-context.cc'],
738*2d1272b8SAndroid Build Coastguard Worker    'test-instancer-solver': ['test-subset-instancer-solver.cc', 'hb-subset-instancer-solver.cc', 'hb-static.cc'],
739*2d1272b8SAndroid Build Coastguard Worker    'test-priority-queue': ['test-priority-queue.cc', 'hb-static.cc'],
740*2d1272b8SAndroid Build Coastguard Worker    'test-tuple-varstore': ['test-tuple-varstore.cc', 'hb-subset-instancer-solver.cc', 'hb-subset-instancer-iup.cc', 'hb-static.cc'],
741*2d1272b8SAndroid Build Coastguard Worker    'test-item-varstore': ['test-item-varstore.cc', 'hb-subset-instancer-solver.cc', 'hb-subset-instancer-iup.cc', 'hb-static.cc'],
742*2d1272b8SAndroid Build Coastguard Worker    'test-unicode-ranges': ['test-unicode-ranges.cc'],
743*2d1272b8SAndroid Build Coastguard Worker  }
744*2d1272b8SAndroid Build Coastguard Worker  foreach name, source : compiled_tests
745*2d1272b8SAndroid Build Coastguard Worker    if cpp.get_define('_MSC_FULL_VER') != '' and source.contains('hb-static.cc')
746*2d1272b8SAndroid Build Coastguard Worker      # TODO: Microsoft compilers cannot link tests using hb-static.cc, fix them
747*2d1272b8SAndroid Build Coastguard Worker      continue
748*2d1272b8SAndroid Build Coastguard Worker    endif
749*2d1272b8SAndroid Build Coastguard Worker    test(name, executable(name, source,
750*2d1272b8SAndroid Build Coastguard Worker      include_directories: incconfig,
751*2d1272b8SAndroid Build Coastguard Worker      cpp_args: cpp_args + ['-DMAIN', '-UNDEBUG'],
752*2d1272b8SAndroid Build Coastguard Worker      dependencies: libharfbuzz_dep,
753*2d1272b8SAndroid Build Coastguard Worker      install: false,
754*2d1272b8SAndroid Build Coastguard Worker    ), suite: ['src'])
755*2d1272b8SAndroid Build Coastguard Worker  endforeach
756*2d1272b8SAndroid Build Coastguard Workerendif
757*2d1272b8SAndroid Build Coastguard Worker
758*2d1272b8SAndroid Build Coastguard Workerpkgmod.generate(libharfbuzz,
759*2d1272b8SAndroid Build Coastguard Worker  description: 'HarfBuzz text shaping library',
760*2d1272b8SAndroid Build Coastguard Worker  subdirs: [meson.project_name()],
761*2d1272b8SAndroid Build Coastguard Worker  version: meson.project_version(),
762*2d1272b8SAndroid Build Coastguard Worker)
763*2d1272b8SAndroid Build Coastguard Worker
764*2d1272b8SAndroid Build Coastguard Workerpkgmod.generate(libharfbuzz_subset,
765*2d1272b8SAndroid Build Coastguard Worker  description: 'HarfBuzz font subsetter',
766*2d1272b8SAndroid Build Coastguard Worker  requires: ['harfbuzz = @0@'.format(meson.project_version())],
767*2d1272b8SAndroid Build Coastguard Worker  subdirs: [meson.project_name()],
768*2d1272b8SAndroid Build Coastguard Worker  version: meson.project_version(),
769*2d1272b8SAndroid Build Coastguard Worker)
770*2d1272b8SAndroid Build Coastguard Worker
771*2d1272b8SAndroid Build Coastguard Workerlibharfbuzz_icu_dep = null_dep
772*2d1272b8SAndroid Build Coastguard Workerif have_icu and not have_icu_builtin
773*2d1272b8SAndroid Build Coastguard Worker  harfbuzz_icu_def = custom_target('harfbuzz-icu.def',
774*2d1272b8SAndroid Build Coastguard Worker    command: gen_def_cmd,
775*2d1272b8SAndroid Build Coastguard Worker    input: [hb_icu_headers],
776*2d1272b8SAndroid Build Coastguard Worker    output: 'harfbuzz-icu.def')
777*2d1272b8SAndroid Build Coastguard Worker  defs_list += [harfbuzz_icu_def]
778*2d1272b8SAndroid Build Coastguard Worker
779*2d1272b8SAndroid Build Coastguard Worker  libharfbuzz_icu = library('harfbuzz-icu', [hb_icu_sources, hb_icu_headers],
780*2d1272b8SAndroid Build Coastguard Worker    include_directories: incconfig,
781*2d1272b8SAndroid Build Coastguard Worker    dependencies: icu_dep,
782*2d1272b8SAndroid Build Coastguard Worker    link_with: [libharfbuzz],
783*2d1272b8SAndroid Build Coastguard Worker    cpp_args: cpp_args + extra_hb_cpp_args,
784*2d1272b8SAndroid Build Coastguard Worker    soversion: hb_so_version,
785*2d1272b8SAndroid Build Coastguard Worker    version: version,
786*2d1272b8SAndroid Build Coastguard Worker    install: true,
787*2d1272b8SAndroid Build Coastguard Worker    darwin_versions: darwin_versions,
788*2d1272b8SAndroid Build Coastguard Worker    # ICU links to stdc++ anyway so the default linker is good
789*2d1272b8SAndroid Build Coastguard Worker    # link_language: chosen_linker,
790*2d1272b8SAndroid Build Coastguard Worker  )
791*2d1272b8SAndroid Build Coastguard Worker
792*2d1272b8SAndroid Build Coastguard Worker  libharfbuzz_icu_dep = declare_dependency(
793*2d1272b8SAndroid Build Coastguard Worker    link_with: libharfbuzz_icu,
794*2d1272b8SAndroid Build Coastguard Worker    include_directories: incsrc,
795*2d1272b8SAndroid Build Coastguard Worker    dependencies: icu_dep)
796*2d1272b8SAndroid Build Coastguard Worker  meson.override_dependency('harfbuzz-icu', libharfbuzz_icu_dep)
797*2d1272b8SAndroid Build Coastguard Worker
798*2d1272b8SAndroid Build Coastguard Worker  pkgmod.generate(libharfbuzz_icu,
799*2d1272b8SAndroid Build Coastguard Worker    description: 'HarfBuzz text shaping library ICU integration',
800*2d1272b8SAndroid Build Coastguard Worker    requires: ['harfbuzz = @0@'.format(meson.project_version())],
801*2d1272b8SAndroid Build Coastguard Worker    subdirs: [meson.project_name()],
802*2d1272b8SAndroid Build Coastguard Worker    version: meson.project_version(),
803*2d1272b8SAndroid Build Coastguard Worker  )
804*2d1272b8SAndroid Build Coastguard Worker
805*2d1272b8SAndroid Build Coastguard Worker  install_headers(hb_icu_headers, subdir: meson.project_name())
806*2d1272b8SAndroid Build Coastguard Workerendif
807*2d1272b8SAndroid Build Coastguard Worker
808*2d1272b8SAndroid Build Coastguard Workerhave_gobject = conf.get('HAVE_GOBJECT', 0) == 1
809*2d1272b8SAndroid Build Coastguard Worker
810*2d1272b8SAndroid Build Coastguard Worker# This code (especially PACKAGE_INIT) kept similar to what CMake's own
811*2d1272b8SAndroid Build Coastguard Worker# configure_package_config_file() generates, see
812*2d1272b8SAndroid Build Coastguard Worker# https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#command:configure_package_config_file
813*2d1272b8SAndroid Build Coastguard Worker
814*2d1272b8SAndroid Build Coastguard Workercmake_config = configuration_data()
815*2d1272b8SAndroid Build Coastguard Workercmake_config_dir = cmake_package_install_dir / 'harfbuzz'
816*2d1272b8SAndroid Build Coastguard Worker
817*2d1272b8SAndroid Build Coastguard Workerhave_fs_relative_to = meson.version().version_compare('>=1.3.0')
818*2d1272b8SAndroid Build Coastguard Worker
819*2d1272b8SAndroid Build Coastguard Workerif not have_fs_relative_to
820*2d1272b8SAndroid Build Coastguard Worker  relative_to = find_program('relative_to.py')
821*2d1272b8SAndroid Build Coastguard Workerendif
822*2d1272b8SAndroid Build Coastguard Worker
823*2d1272b8SAndroid Build Coastguard Workerif have_fs_relative_to
824*2d1272b8SAndroid Build Coastguard Worker  cmake_package_prefix_dir = fs.relative_to(get_option('prefix'), get_option('prefix') / cmake_config_dir)
825*2d1272b8SAndroid Build Coastguard Workerelse
826*2d1272b8SAndroid Build Coastguard Worker  cmake_package_prefix_dir = run_command(relative_to, get_option('prefix'), get_option('prefix') / cmake_config_dir, check: true).stdout().strip()
827*2d1272b8SAndroid Build Coastguard Workerendif
828*2d1272b8SAndroid Build Coastguard Worker
829*2d1272b8SAndroid Build Coastguard Workercmake_package_prefix_dir = '${CMAKE_CURRENT_LIST_DIR}/@0@'.format(cmake_package_prefix_dir)
830*2d1272b8SAndroid Build Coastguard Worker
831*2d1272b8SAndroid Build Coastguard Worker# Make all the relevant paths relative to our prefix, so we can later append
832*2d1272b8SAndroid Build Coastguard Worker# them onto ${PACKAGE_PREFIX_DIR} to get the correct paths.
833*2d1272b8SAndroid Build Coastguard Worker
834*2d1272b8SAndroid Build Coastguard Workercmake_install_includedir = get_option('includedir')
835*2d1272b8SAndroid Build Coastguard Worker
836*2d1272b8SAndroid Build Coastguard Workerif fs.is_absolute(cmake_install_includedir)
837*2d1272b8SAndroid Build Coastguard Worker  if have_fs_relative_to
838*2d1272b8SAndroid Build Coastguard Worker    cmake_install_includedir = fs.relative_to(cmake_install_includedir, get_option('prefix'))
839*2d1272b8SAndroid Build Coastguard Worker  else
840*2d1272b8SAndroid Build Coastguard Worker    cmake_install_includedir = run_command(relative_to, cmake_install_includedir, get_option('prefix'), check: true).stdout().strip()
841*2d1272b8SAndroid Build Coastguard Worker  endif
842*2d1272b8SAndroid Build Coastguard Workerendif
843*2d1272b8SAndroid Build Coastguard Worker
844*2d1272b8SAndroid Build Coastguard Workercmake_install_libdir = get_option('libdir')
845*2d1272b8SAndroid Build Coastguard Worker
846*2d1272b8SAndroid Build Coastguard Workerif fs.is_absolute(cmake_install_libdir)
847*2d1272b8SAndroid Build Coastguard Worker  if have_fs_relative_to
848*2d1272b8SAndroid Build Coastguard Worker    cmake_install_libdir = fs.relative_to(cmake_install_libdir, get_option('prefix'))
849*2d1272b8SAndroid Build Coastguard Worker  else
850*2d1272b8SAndroid Build Coastguard Worker    cmake_install_libdir = run_command(relative_to, cmake_install_libdir, get_option('prefix'), check: true).stdout().strip()
851*2d1272b8SAndroid Build Coastguard Worker  endif
852*2d1272b8SAndroid Build Coastguard Workerendif
853*2d1272b8SAndroid Build Coastguard Worker
854*2d1272b8SAndroid Build Coastguard Workercmake_config.set('PACKAGE_INIT', '''
855*2d1272b8SAndroid Build Coastguard Workerget_filename_component(PACKAGE_PREFIX_DIR "@0@" ABSOLUTE)
856*2d1272b8SAndroid Build Coastguard Worker
857*2d1272b8SAndroid Build Coastguard Workermacro(set_and_check _var _file)
858*2d1272b8SAndroid Build Coastguard Worker  set(${_var} "${_file}")
859*2d1272b8SAndroid Build Coastguard Worker  if(NOT EXISTS "${_file}")
860*2d1272b8SAndroid Build Coastguard Worker    message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
861*2d1272b8SAndroid Build Coastguard Worker  endif()
862*2d1272b8SAndroid Build Coastguard Workerendmacro()
863*2d1272b8SAndroid Build Coastguard Worker
864*2d1272b8SAndroid Build Coastguard Workermacro(check_required_components _NAME)
865*2d1272b8SAndroid Build Coastguard Worker  foreach(comp ${${_NAME}_FIND_COMPONENTS})
866*2d1272b8SAndroid Build Coastguard Worker    if(NOT ${_NAME}_${comp}_FOUND)
867*2d1272b8SAndroid Build Coastguard Worker      if(${_NAME}_FIND_REQUIRED_${comp})
868*2d1272b8SAndroid Build Coastguard Worker        set(${_NAME}_FOUND FALSE)
869*2d1272b8SAndroid Build Coastguard Worker      endif()
870*2d1272b8SAndroid Build Coastguard Worker    endif()
871*2d1272b8SAndroid Build Coastguard Worker  endforeach()
872*2d1272b8SAndroid Build Coastguard Workerendmacro()
873*2d1272b8SAndroid Build Coastguard Worker'''.format(cmake_package_prefix_dir))
874*2d1272b8SAndroid Build Coastguard Worker
875*2d1272b8SAndroid Build Coastguard Workercmake_config.set('PACKAGE_CMAKE_INSTALL_INCLUDEDIR', '${PACKAGE_PREFIX_DIR}/@0@'.format(cmake_install_includedir))
876*2d1272b8SAndroid Build Coastguard Workercmake_config.set('PACKAGE_CMAKE_INSTALL_LIBDIR', '${PACKAGE_PREFIX_DIR}/@0@'.format(cmake_install_libdir))
877*2d1272b8SAndroid Build Coastguard Workercmake_config.set('PACKAGE_INCLUDE_INSTALL_DIR', '${PACKAGE_PREFIX_DIR}/@0@/@1@'.format(cmake_install_includedir, meson.project_name()))
878*2d1272b8SAndroid Build Coastguard Workercmake_config.set('HB_HAVE_GOBJECT', have_gobject ? 'YES' : 'NO')
879*2d1272b8SAndroid Build Coastguard Workercmake_config.set('HB_LIBRARY_TYPE', get_option('default_library') == 'static' ? 'STATIC' : 'SHARED')
880*2d1272b8SAndroid Build Coastguard Worker
881*2d1272b8SAndroid Build Coastguard Workerif get_option('default_library') == 'static'
882*2d1272b8SAndroid Build Coastguard Worker  cmake_config.set('HB_LIB_PREFIX', '${CMAKE_STATIC_LIBRARY_PREFIX}')
883*2d1272b8SAndroid Build Coastguard Worker  cmake_config.set('HB_LIB_SUFFIX', '${CMAKE_STATIC_LIBRARY_SUFFIX}')
884*2d1272b8SAndroid Build Coastguard Workerelif host_machine.system() == 'darwin'
885*2d1272b8SAndroid Build Coastguard Worker  cmake_config.set('HB_LIB_PREFIX', '${CMAKE_SHARED_LIBRARY_PREFIX}')
886*2d1272b8SAndroid Build Coastguard Worker  cmake_config.set('HB_LIB_SUFFIX', '.@0@${CMAKE_SHARED_LIBRARY_SUFFIX}'.format(hb_so_version))
887*2d1272b8SAndroid Build Coastguard Workerelif host_machine.system() == 'windows'
888*2d1272b8SAndroid Build Coastguard Worker  cmake_config.set('HB_LIB_PREFIX', '${CMAKE_IMPORT_LIBRARY_PREFIX}')
889*2d1272b8SAndroid Build Coastguard Worker  cmake_config.set('HB_LIB_SUFFIX', '${CMAKE_IMPORT_LIBRARY_SUFFIX}')
890*2d1272b8SAndroid Build Coastguard Workerelse
891*2d1272b8SAndroid Build Coastguard Worker  cmake_config.set('HB_LIB_PREFIX', '${CMAKE_SHARED_LIBRARY_PREFIX}')
892*2d1272b8SAndroid Build Coastguard Worker  cmake_config.set('HB_LIB_SUFFIX', '${CMAKE_SHARED_LIBRARY_SUFFIX}.@0@'.format(version))
893*2d1272b8SAndroid Build Coastguard Workerendif
894*2d1272b8SAndroid Build Coastguard Worker
895*2d1272b8SAndroid Build Coastguard Workerconfigure_file(input: 'harfbuzz-config.cmake.in',
896*2d1272b8SAndroid Build Coastguard Worker  output: 'harfbuzz-config.cmake',
897*2d1272b8SAndroid Build Coastguard Worker  configuration: cmake_config,
898*2d1272b8SAndroid Build Coastguard Worker  install_dir: cmake_config_dir,
899*2d1272b8SAndroid Build Coastguard Worker)
900*2d1272b8SAndroid Build Coastguard Worker
901*2d1272b8SAndroid Build Coastguard Workergobject_enums_c = []
902*2d1272b8SAndroid Build Coastguard Workergobject_enums_h = []
903*2d1272b8SAndroid Build Coastguard Workerlibharfbuzz_gobject_dep = null_dep
904*2d1272b8SAndroid Build Coastguard Workerif have_gobject
905*2d1272b8SAndroid Build Coastguard Worker  gnome = import('gnome')
906*2d1272b8SAndroid Build Coastguard Worker
907*2d1272b8SAndroid Build Coastguard Worker  h_templ = configure_file(
908*2d1272b8SAndroid Build Coastguard Worker    input: 'hb-gobject-enums.h.tmpl',
909*2d1272b8SAndroid Build Coastguard Worker    output: 'hb-gobject-enums-tmp.h.tmpl',
910*2d1272b8SAndroid Build Coastguard Worker    copy: true)
911*2d1272b8SAndroid Build Coastguard Worker
912*2d1272b8SAndroid Build Coastguard Worker  cc_templ = configure_file(
913*2d1272b8SAndroid Build Coastguard Worker    input: 'hb-gobject-enums.cc.tmpl',
914*2d1272b8SAndroid Build Coastguard Worker    output: 'hb-gobject-enums-tmp.cc.tmpl',
915*2d1272b8SAndroid Build Coastguard Worker    copy: true)
916*2d1272b8SAndroid Build Coastguard Worker
917*2d1272b8SAndroid Build Coastguard Worker  enums = gnome.mkenums('hb-gobject',
918*2d1272b8SAndroid Build Coastguard Worker    sources: hb_headers,
919*2d1272b8SAndroid Build Coastguard Worker    h_template: h_templ,
920*2d1272b8SAndroid Build Coastguard Worker    c_template: cc_templ,
921*2d1272b8SAndroid Build Coastguard Worker    identifier_prefix: 'hb_',
922*2d1272b8SAndroid Build Coastguard Worker    symbol_prefix: 'hb_gobject',
923*2d1272b8SAndroid Build Coastguard Worker  )
924*2d1272b8SAndroid Build Coastguard Worker
925*2d1272b8SAndroid Build Coastguard Worker  gobject_enums_c = custom_target('hb-gobject-enums.cc',
926*2d1272b8SAndroid Build Coastguard Worker    input: enums[0],
927*2d1272b8SAndroid Build Coastguard Worker    output: 'hb-gobject-enums.cc',
928*2d1272b8SAndroid Build Coastguard Worker    command: [find_program('fix_get_types.py'), '@INPUT@', '@OUTPUT@']
929*2d1272b8SAndroid Build Coastguard Worker  )
930*2d1272b8SAndroid Build Coastguard Worker
931*2d1272b8SAndroid Build Coastguard Worker  gobject_enums_h = custom_target('hb-gobject-enums.h',
932*2d1272b8SAndroid Build Coastguard Worker    input: enums[1],
933*2d1272b8SAndroid Build Coastguard Worker    output: 'hb-gobject-enums.h',
934*2d1272b8SAndroid Build Coastguard Worker    command: [find_program('fix_get_types.py'), '@INPUT@', '@OUTPUT@'],
935*2d1272b8SAndroid Build Coastguard Worker    install: true,
936*2d1272b8SAndroid Build Coastguard Worker    install_dir: get_option('prefix') / get_option('includedir') / meson.project_name(),
937*2d1272b8SAndroid Build Coastguard Worker  )
938*2d1272b8SAndroid Build Coastguard Worker
939*2d1272b8SAndroid Build Coastguard Worker  hb_gobject_sources += [gobject_enums_c]
940*2d1272b8SAndroid Build Coastguard Worker
941*2d1272b8SAndroid Build Coastguard Worker  harfbuzz_gobject_def = custom_target('harfbuzz-gobject.def',
942*2d1272b8SAndroid Build Coastguard Worker    command: gen_def_cmd,
943*2d1272b8SAndroid Build Coastguard Worker    input: [hb_gobject_headers, gobject_enums_h],
944*2d1272b8SAndroid Build Coastguard Worker    output: 'harfbuzz-gobject.def')
945*2d1272b8SAndroid Build Coastguard Worker  defs_list += [harfbuzz_gobject_def]
946*2d1272b8SAndroid Build Coastguard Worker
947*2d1272b8SAndroid Build Coastguard Worker  libharfbuzz_gobject = library('harfbuzz-gobject', [hb_gobject_sources, gobject_enums_c, gobject_enums_h],
948*2d1272b8SAndroid Build Coastguard Worker    include_directories: incconfig,
949*2d1272b8SAndroid Build Coastguard Worker    dependencies: [glib_dep, gobject_dep],
950*2d1272b8SAndroid Build Coastguard Worker    link_with: [libharfbuzz],
951*2d1272b8SAndroid Build Coastguard Worker    cpp_args: cpp_args + extra_hb_cpp_args,
952*2d1272b8SAndroid Build Coastguard Worker    soversion: hb_so_version,
953*2d1272b8SAndroid Build Coastguard Worker    version: version,
954*2d1272b8SAndroid Build Coastguard Worker    install: true,
955*2d1272b8SAndroid Build Coastguard Worker    darwin_versions: darwin_versions,
956*2d1272b8SAndroid Build Coastguard Worker    link_language: chosen_linker,
957*2d1272b8SAndroid Build Coastguard Worker  )
958*2d1272b8SAndroid Build Coastguard Worker
959*2d1272b8SAndroid Build Coastguard Worker  gir = find_program('g-ir-scanner', required: get_option('introspection'))
960*2d1272b8SAndroid Build Coastguard Worker  build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
961*2d1272b8SAndroid Build Coastguard Worker
962*2d1272b8SAndroid Build Coastguard Worker  build_gir = build_gir and get_option('default_library') != 'static'
963*2d1272b8SAndroid Build Coastguard Worker  if not build_gir and get_option('introspection').enabled()
964*2d1272b8SAndroid Build Coastguard Worker    error('Introspection support is requested but the default library option should be shared or both')
965*2d1272b8SAndroid Build Coastguard Worker  endif
966*2d1272b8SAndroid Build Coastguard Worker
967*2d1272b8SAndroid Build Coastguard Worker  if build_gir
968*2d1272b8SAndroid Build Coastguard Worker    conf.set('HAVE_INTROSPECTION', 1)
969*2d1272b8SAndroid Build Coastguard Worker    hb_gen_files_gir = gnome.generate_gir([libharfbuzz_gobject, libharfbuzz],
970*2d1272b8SAndroid Build Coastguard Worker      sources: [gir_headers, gir_sources, gobject_enums_h],
971*2d1272b8SAndroid Build Coastguard Worker      dependencies: libharfbuzz_dep,
972*2d1272b8SAndroid Build Coastguard Worker      namespace: 'HarfBuzz',
973*2d1272b8SAndroid Build Coastguard Worker      nsversion: '0.0',
974*2d1272b8SAndroid Build Coastguard Worker      identifier_prefix: 'hb_',
975*2d1272b8SAndroid Build Coastguard Worker      symbol_prefix: ['hb', 'hb_gobject'],
976*2d1272b8SAndroid Build Coastguard Worker      includes: ['GObject-2.0', 'freetype2-2.0'],
977*2d1272b8SAndroid Build Coastguard Worker      export_packages: ['harfbuzz-gobject', 'harfbuzz'],
978*2d1272b8SAndroid Build Coastguard Worker      header: 'hb-gobject.h',
979*2d1272b8SAndroid Build Coastguard Worker      install: true,
980*2d1272b8SAndroid Build Coastguard Worker      extra_args:  ['--cflags-begin',
981*2d1272b8SAndroid Build Coastguard Worker                    '-DHB_NO_SINGLE_HEADER_ERROR',
982*2d1272b8SAndroid Build Coastguard Worker                    '-DHAVE_GOBJECT',
983*2d1272b8SAndroid Build Coastguard Worker                    '-DHB_EXTERN=',
984*2d1272b8SAndroid Build Coastguard Worker                    '--cflags-end'])
985*2d1272b8SAndroid Build Coastguard Worker  endif
986*2d1272b8SAndroid Build Coastguard Worker
987*2d1272b8SAndroid Build Coastguard Worker  libharfbuzz_gobject_dep = declare_dependency(
988*2d1272b8SAndroid Build Coastguard Worker    link_with: libharfbuzz_gobject,
989*2d1272b8SAndroid Build Coastguard Worker    include_directories: incsrc,
990*2d1272b8SAndroid Build Coastguard Worker    sources: build_gir ? hb_gen_files_gir : hb_gobject_sources,
991*2d1272b8SAndroid Build Coastguard Worker    dependencies: [glib_dep, gobject_dep])
992*2d1272b8SAndroid Build Coastguard Worker  meson.override_dependency('harfbuzz-gobject', libharfbuzz_gobject_dep)
993*2d1272b8SAndroid Build Coastguard Worker
994*2d1272b8SAndroid Build Coastguard Worker  pkgmod.generate(libharfbuzz_gobject,
995*2d1272b8SAndroid Build Coastguard Worker    description: 'HarfBuzz text shaping library GObject integration',
996*2d1272b8SAndroid Build Coastguard Worker    requires: ['harfbuzz = @0@'.format(meson.project_version()), 'glib-2.0', 'gobject-2.0'],
997*2d1272b8SAndroid Build Coastguard Worker    subdirs: [meson.project_name()],
998*2d1272b8SAndroid Build Coastguard Worker    version: meson.project_version(),
999*2d1272b8SAndroid Build Coastguard Worker  )
1000*2d1272b8SAndroid Build Coastguard Worker
1001*2d1272b8SAndroid Build Coastguard Worker  install_headers(hb_gobject_headers, subdir: meson.project_name())
1002*2d1272b8SAndroid Build Coastguard Workerelse
1003*2d1272b8SAndroid Build Coastguard Worker  if get_option('introspection').enabled()
1004*2d1272b8SAndroid Build Coastguard Worker    error('introspection requires gobject to be enabled')
1005*2d1272b8SAndroid Build Coastguard Worker  endif
1006*2d1272b8SAndroid Build Coastguard Workerendif
1007*2d1272b8SAndroid Build Coastguard Worker
1008*2d1272b8SAndroid Build Coastguard Workerif get_option('tests').enabled()
1009*2d1272b8SAndroid Build Coastguard Worker  dist_check_script = [
1010*2d1272b8SAndroid Build Coastguard Worker    'check-c-linkage-decls',
1011*2d1272b8SAndroid Build Coastguard Worker    'check-externs',
1012*2d1272b8SAndroid Build Coastguard Worker    'check-header-guards',
1013*2d1272b8SAndroid Build Coastguard Worker    'check-includes',
1014*2d1272b8SAndroid Build Coastguard Worker  ]
1015*2d1272b8SAndroid Build Coastguard Worker
1016*2d1272b8SAndroid Build Coastguard Worker  env = environment()
1017*2d1272b8SAndroid Build Coastguard Worker  env.set('srcdir', meson.current_source_dir())
1018*2d1272b8SAndroid Build Coastguard Worker  env.set('base_srcdir', meson.source_root())
1019*2d1272b8SAndroid Build Coastguard Worker  env.set('builddir', meson.current_build_dir())
1020*2d1272b8SAndroid Build Coastguard Worker  env.set('libs', meson.current_build_dir()) # TODO: Merge this with builddir after autotools removal
1021*2d1272b8SAndroid Build Coastguard Worker  HBSOURCES = []
1022*2d1272b8SAndroid Build Coastguard Worker  foreach f : hb_sources
1023*2d1272b8SAndroid Build Coastguard Worker    HBSOURCES += '@0@'.format(f)
1024*2d1272b8SAndroid Build Coastguard Worker  endforeach
1025*2d1272b8SAndroid Build Coastguard Worker  env.set('HBSOURCES', ' '.join(HBSOURCES))
1026*2d1272b8SAndroid Build Coastguard Worker  HBHEADERS = []
1027*2d1272b8SAndroid Build Coastguard Worker  foreach f : hb_headers
1028*2d1272b8SAndroid Build Coastguard Worker    HBHEADERS += '@0@'.format(f)
1029*2d1272b8SAndroid Build Coastguard Worker  endforeach
1030*2d1272b8SAndroid Build Coastguard Worker  env.set('HBHEADERS', ' '.join(HBHEADERS))
1031*2d1272b8SAndroid Build Coastguard Worker
1032*2d1272b8SAndroid Build Coastguard Worker  if cpp.get_argument_syntax() != 'msvc' and not meson.is_cross_build() # ensure the local tools are usable
1033*2d1272b8SAndroid Build Coastguard Worker    dist_check_script += ['check-static-inits', 'check-symbols']
1034*2d1272b8SAndroid Build Coastguard Worker    if get_option('wasm').disabled() and not get_option('with_libstdcxx')
1035*2d1272b8SAndroid Build Coastguard Worker      dist_check_script += ['check-libstdc++']
1036*2d1272b8SAndroid Build Coastguard Worker    endif
1037*2d1272b8SAndroid Build Coastguard Worker  endif
1038*2d1272b8SAndroid Build Coastguard Worker
1039*2d1272b8SAndroid Build Coastguard Worker  foreach name : dist_check_script
1040*2d1272b8SAndroid Build Coastguard Worker    test(name, find_program(name + '.py'),
1041*2d1272b8SAndroid Build Coastguard Worker      env: env,
1042*2d1272b8SAndroid Build Coastguard Worker      depends: name == 'check-symbols' ? defs_list : [],
1043*2d1272b8SAndroid Build Coastguard Worker      suite: ['src'],
1044*2d1272b8SAndroid Build Coastguard Worker    )
1045*2d1272b8SAndroid Build Coastguard Worker  endforeach
1046*2d1272b8SAndroid Build Coastguard Workerendif
1047*2d1272b8SAndroid Build Coastguard Worker
1048*2d1272b8SAndroid Build Coastguard Workerinstall_headers(hb_headers + hb_subset_headers, subdir: meson.project_name())
1049