blob: cd7acff249fd9a7e2c3c12a97626e740e1a7b358 [file] [log] [blame]
Mathieu Duponchelle920efc02018-05-17 01:28:53 +02001project('harfbuzz', 'c', 'cpp',
Khaled Hosny7e9ac8f2021-09-14 07:07:00 +02002 meson_version: '>= 0.52.0',
Khaled Hosnycd5c6cd2021-11-08 06:59:55 +02003 version: '3.1.1',
Ebrahim Byagowiddb103e2020-07-06 22:27:39 +04304 default_options: [
Ebrahim Byagowi97079a72020-08-02 12:34:21 +04305 'cpp_rtti=false', # Just to support msvc, we are passing -fno-exceptions also anyway
Ebrahim Byagowiddb103e2020-07-06 22:27:39 +04306 'cpp_std=c++11',
Ebrahim Byagowi34a05322020-08-04 15:14:59 +04307 'wrap_mode=nofallback', # Use --wrap-mode=default to revert, https://github.com/harfbuzz/harfbuzz/pull/2548
Ebrahim Byagowiddb103e2020-07-06 22:27:39 +04308 ],
Ebrahim Byagowia08ba462020-07-06 00:31:42 +04309)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +020010
Tim-Philipp Müller535186f2018-12-03 20:51:06 +010011hb_version_arr = meson.project_version().split('.')
12hb_version_major = hb_version_arr[0].to_int()
13hb_version_minor = hb_version_arr[1].to_int()
14hb_version_micro = hb_version_arr[2].to_int()
15
16# libtool versioning
17hb_version_int = hb_version_major*10000 + hb_version_minor*100 + hb_version_micro
Ebrahim Byagowief2e3802020-08-12 00:50:33 +043018hb_libtool_version_info = '@0@:0:@0@'.format(hb_version_int)
Tim-Philipp Müller535186f2018-12-03 20:51:06 +010019
Mathieu Duponchelle484313f2018-06-05 02:15:43 +020020pkgmod = import('pkgconfig')
Mathieu Duponchelle920efc02018-05-17 01:28:53 +020021cpp = meson.get_compiler('cpp')
Ebrahim Byagowif2a80ab2020-07-03 04:28:08 +043022null_dep = dependency('', required: false)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +020023
Tim-Philipp Müller4a47f1a2018-12-01 11:05:27 +000024if cpp.get_id() == 'msvc'
25 # Ignore several spurious warnings for things HarfBuzz does very commonly.
26 # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
27 # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
28 # NOTE: Only add warnings here if you are sure they're spurious
29 msvc_args = [
Ebrahim Byagowiddb103e2020-07-06 22:27:39 +043030 '/wd4018', # implicit signed/unsigned conversion
31 '/wd4146', # unary minus on unsigned (beware INT_MIN)
32 '/wd4244', # lossy type conversion (e.g. double -> int)
33 '/wd4305', # truncating type conversion (e.g. double -> float)
34 cpp.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
Tim-Philipp Müller4a47f1a2018-12-01 11:05:27 +000035 ]
Ebrahim Byagowi62de2f72020-06-11 19:09:24 +043036 add_project_arguments(msvc_args, language: ['c', 'cpp'])
Tim-Philipp Müller4a47f1a2018-12-01 11:05:27 +000037 # Disable SAFESEH with MSVC for libs that use external deps that are built with MinGW
38 # noseh_link_args = ['/SAFESEH:NO']
Khaled Hosny22cbd032021-09-14 12:34:25 +020039 # disable exception handling
40 add_project_arguments(['/EHs-', '/EHc-'], language: 'cpp')
Tim-Philipp Müller4a47f1a2018-12-01 11:05:27 +000041endif
42
Ebrahim Byagowi22048d52020-06-05 04:09:07 +043043add_project_link_arguments(cpp.get_supported_link_arguments([
44 '-Bsymbolic-functions'
Ebrahim Byagowi62de2f72020-06-11 19:09:24 +043045]), language: 'c')
Ebrahim Byagowi22048d52020-06-05 04:09:07 +043046
Tim-Philipp Müllerbb8aaa32020-03-14 01:05:38 +000047add_project_arguments(cpp.get_supported_arguments([
Ebrahim Byagowi365d2d32020-03-11 20:16:36 +033048 '-fno-exceptions',
Ebrahim Byagowi97079a72020-08-02 12:34:21 +043049 '-fno-rtti',
Ebrahim Byagowi365d2d32020-03-11 20:16:36 +033050 '-fno-threadsafe-statics',
Ebrahim Byagowi749e2752020-08-02 12:21:51 +043051 '-fvisibility-inlines-hidden',
Ebrahim Byagowi62de2f72020-06-11 19:09:24 +043052]), language: 'cpp')
Ebrahim Byagowi365d2d32020-03-11 20:16:36 +033053
54if host_machine.cpu_family() == 'arm' and cpp.alignment('struct { char c; }') != 1
55 if cpp.has_argument('-mstructure-size-boundary=8')
Ebrahim Byagowi62de2f72020-06-11 19:09:24 +043056 add_project_arguments('-mstructure-size-boundary=8', language: 'cpp')
Ebrahim Byagowi365d2d32020-03-11 20:16:36 +033057 endif
58endif
59
Mathieu Duponchelle920efc02018-05-17 01:28:53 +020060check_headers = [
61 ['unistd.h'],
62 ['sys/mman.h'],
Mathieu Duponchelle920efc02018-05-17 01:28:53 +020063 ['stdbool.h'],
64]
65
66check_funcs = [
67 ['atexit'],
68 ['mprotect'],
69 ['sysconf'],
70 ['getpagesize'],
71 ['mmap'],
72 ['isatty'],
Mathieu Duponchelle920efc02018-05-17 01:28:53 +020073]
74
Ebrahim Byagowib8454c32020-06-11 18:32:13 +043075m_dep = cpp.find_library('m', required: false)
76
Ebrahim Byagowi42d039c2020-07-03 04:32:32 +043077freetype_dep = null_dep
Ebrahim Byagowiebab4b82020-06-10 16:52:32 +043078if not get_option('freetype').disabled()
79 freetype_dep = dependency('freetype2', required: false)
Ebrahim Byagowib8454c32020-06-11 18:32:13 +043080
Ebrahim Byagowi24b42002020-08-13 09:06:39 +043081 if (not freetype_dep.found() and
82 cpp.get_id() == 'msvc' and
83 cpp.has_header('ft2build.h'))
84 freetype_dep = cpp.find_library('freetype', required: false)
Ebrahim Byagowib8454c32020-06-11 18:32:13 +043085 endif
86
Xavier Claessensc4bbe892020-06-24 13:40:55 -040087 if not freetype_dep.found()
Ebrahim Byagowi020b1822020-07-01 14:22:46 +043088 # https://github.com/harfbuzz/harfbuzz/pull/2498
89 freetype_dep = dependency('freetype2', required: get_option('freetype'),
90 fallback: ['freetype2', 'freetype_dep'],
91 default_options: ['harfbuzz=disabled'])
Ebrahim Byagowib8454c32020-06-11 18:32:13 +043092 endif
Ebrahim Byagowiebab4b82020-06-10 16:52:32 +043093endif
Chun-wei Fan733414b2020-03-13 16:15:21 +080094
Tim-Philipp Müller49ba2112018-11-12 15:36:27 +000095glib_dep = dependency('glib-2.0', required: get_option('glib'),
Nirbheek Chauhanf65def42018-10-12 19:41:49 +053096 fallback: ['glib', 'libglib_dep'])
Tim-Philipp Müller49ba2112018-11-12 15:36:27 +000097gobject_dep = dependency('gobject-2.0', required: get_option('gobject'),
Nirbheek Chauhanf65def42018-10-12 19:41:49 +053098 fallback: ['glib', 'libgobject_dep'])
Khaled Hosny792ca302021-10-05 19:00:29 +020099graphite2_dep = dependency('graphite2', required: get_option('graphite2'))
100graphite_dep = dependency('graphite2', required: get_option('graphite'))
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200101
Ebrahim Byagowi42d039c2020-07-03 04:32:32 +0430102icu_dep = null_dep
Ebrahim Byagowiebab4b82020-06-10 16:52:32 +0430103if not get_option('icu').disabled()
104 icu_dep = dependency('icu-uc', required: false)
Ebrahim Byagowib8454c32020-06-11 18:32:13 +0430105
Ebrahim Byagowi24b42002020-08-13 09:06:39 +0430106 if (not icu_dep.found() and
107 cpp.get_id() == 'msvc' and
108 cpp.has_header('unicode/uchar.h') and
109 cpp.has_header('unicode/unorm2.h') and
110 cpp.has_header('unicode/ustring.h') and
111 cpp.has_header('unicode/utf16.h') and
112 cpp.has_header('unicode/uversion.h') and
113 cpp.has_header('unicode/uscript.h'))
114 if get_option('buildtype') == 'debug'
115 icu_dep = cpp.find_library('icuucd', required: false)
116 else
117 icu_dep = cpp.find_library('icuuc', required: false)
118 endif
Ebrahim Byagowib8454c32020-06-11 18:32:13 +0430119 endif
120
Ebrahim Byagowi24b42002020-08-13 09:06:39 +0430121 if not icu_dep.found()
122 icu_dep = dependency('icu-uc', required: get_option('icu'))
Chun-wei Fan5efce602020-03-13 16:40:20 +0800123 endif
124endif
125
Ebrahim Byagowi42d039c2020-07-03 04:32:32 +0430126cairo_dep = null_dep
127cairo_ft_dep = null_dep
Ebrahim Byagowiebab4b82020-06-10 16:52:32 +0430128if not get_option('cairo').disabled()
129 cairo_dep = dependency('cairo', required: false)
Xavier Claessense2ba0e02020-10-03 21:34:24 -0400130 cairo_ft_dep = dependency('cairo-ft', required: false)
Chun-wei Fan9d0e6ae2020-03-13 16:56:55 +0800131
Ebrahim Byagowi24b42002020-08-13 09:06:39 +0430132 if (not cairo_dep.found() and
133 cpp.get_id() == 'msvc' and
134 cpp.has_header('cairo.h'))
135 cairo_dep = cpp.find_library('cairo', required: false)
Xavier Claessense2ba0e02020-10-03 21:34:24 -0400136 if cairo_dep.found() and cpp.has_function('cairo_ft_font_face_create_for_ft_face',
137 prefix: '#include <cairo-ft.h>',
138 dependencies: cairo_dep)
139 cairo_ft_dep = cairo_dep
140 endif
Nirbheek Chauhanf65def42018-10-12 19:41:49 +0530141 endif
Ebrahim Byagowib8454c32020-06-11 18:32:13 +0430142
Xavier Claessens00c652a2020-06-24 14:11:32 -0400143 if not cairo_dep.found()
Xavier Claessense2ba0e02020-10-03 21:34:24 -0400144 # Requires Meson 0.54.0 to use cairo subproject
145 if meson.version().version_compare('>=0.54.0')
146 # Note that we don't have harfbuzz -> cairo -> freetype2 -> harfbuzz fallback
147 # dependency cycle here because we have configured freetype2 above with
148 # harfbuzz support disabled, so when cairo will lookup freetype2 dependency
149 # it will be forced to use that one.
150 cairo_dep = dependency('cairo', fallback: 'cairo', required: get_option('cairo'))
151 cairo_ft_dep = dependency('cairo-ft', fallback: 'cairo', required: get_option('cairo'))
152 elif get_option('cairo').enabled()
153 error('cairo feature is enabled but it cannot be found on the system and ' +
154 'meson>=0.54.0 is required to build it as subproject')
Ebrahim Byagowib8454c32020-06-11 18:32:13 +0430155 endif
Ebrahim Byagowib8454c32020-06-11 18:32:13 +0430156 endif
Nirbheek Chauhanf65def42018-10-12 19:41:49 +0530157endif
158
Hans Petter Jansson8298c2f2021-04-23 18:37:58 +0200159chafa_dep = dependency('chafa', version: '>= 1.6.0', required: get_option('chafa'))
160
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200161conf = configuration_data()
Tim-Philipp Müller618584e2018-11-14 20:19:36 +0000162incconfig = include_directories('.')
Tim-Philipp Müllera3892be2020-03-14 01:08:15 +0000163
164add_project_arguments('-DHAVE_CONFIG_H', language: ['c', 'cpp'])
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200165
166warn_cflags = [
167 '-Wno-non-virtual-dtor',
168]
169
Tim-Philipp Müllera3892be2020-03-14 01:08:15 +0000170cpp_args = cpp.get_supported_arguments(warn_cflags)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200171
172if glib_dep.found()
173 conf.set('HAVE_GLIB', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200174endif
175
176if gobject_dep.found()
177 conf.set('HAVE_GOBJECT', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200178endif
179
180if cairo_dep.found()
181 conf.set('HAVE_CAIRO', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200182endif
183
184if cairo_ft_dep.found()
185 conf.set('HAVE_CAIRO_FT', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200186endif
187
Hans Petter Jansson8298c2f2021-04-23 18:37:58 +0200188if chafa_dep.found()
189 conf.set('HAVE_CHAFA', 1)
190endif
191
Khaled Hosny792ca302021-10-05 19:00:29 +0200192if graphite2_dep.found() or graphite_dep.found()
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200193 conf.set('HAVE_GRAPHITE2', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200194endif
195
196if icu_dep.found()
197 conf.set('HAVE_ICU', 1)
Ebrahim Byagowic6b3f732020-04-19 00:54:24 +0430198endif
199
Ebrahim Byagowicc53fd12020-05-21 19:33:18 +0430200if get_option('icu_builtin')
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200201 conf.set('HAVE_ICU_BUILTIN', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200202endif
203
Ebrahim Byagowicc53fd12020-05-21 19:33:18 +0430204if get_option('experimental_api')
Ebrahim Byagowi750bb732020-04-21 01:13:13 +0430205 conf.set('HB_EXPERIMENTAL_API', 1)
206endif
207
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200208if freetype_dep.found()
209 conf.set('HAVE_FREETYPE', 1)
Mathieu Duponchelle04bcdb92018-06-05 20:59:29 +0200210 check_freetype_funcs = [
211 ['FT_Get_Var_Blend_Coordinates', {'deps': freetype_dep}],
212 ['FT_Set_Var_Blend_Coordinates', {'deps': freetype_dep}],
213 ['FT_Done_MM_Var', {'deps': freetype_dep}],
214 ]
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200215
216 if freetype_dep.type_name() == 'internal'
217 foreach func: check_freetype_funcs
218 name = func[0]
219 conf.set('HAVE_@0@'.format(name.to_upper()), 1)
220 endforeach
221 else
222 check_funcs += check_freetype_funcs
223 endif
224endif
225
Christoph Reiter03bd6ea2020-06-03 23:52:10 +0200226gdi_uniscribe_deps = []
Ebrahim Byagowiddb103e2020-07-06 22:27:39 +0430227# GDI (Uniscribe) (Windows)
Chun-wei Fan838346c2020-03-13 18:01:17 +0800228if host_machine.system() == 'windows' and not get_option('gdi').disabled()
Ebrahim Byagowi0a02f1e2020-08-13 15:33:39 +0430229 if (get_option('directwrite').enabled() and
230 not (cpp.has_header('usp10.h') and cpp.has_header('windows.h')))
231 error('GDI/Uniscribe was enabled explicitly, but required headers are missing.')
232 endif
Ebrahim Byagowif62f4e32020-07-08 00:26:40 +0430233
Ebrahim Byagowi0a02f1e2020-08-13 15:33:39 +0430234 gdi_deps_found = true
Ebrahim Byagowif62f4e32020-07-08 00:26:40 +0430235 foreach usplib : ['usp10', 'gdi32', 'rpcrt4']
Ebrahim Byagowi24b42002020-08-13 09:06:39 +0430236 dep = cpp.find_library(usplib, required: get_option('gdi'))
Ebrahim Byagowif62f4e32020-07-08 00:26:40 +0430237 gdi_deps_found = gdi_deps_found and dep.found()
238 gdi_uniscribe_deps += dep
239 endforeach
240
241 if gdi_deps_found
Tim-Philipp Müllerb7796a52018-11-12 16:56:56 +0000242 conf.set('HAVE_UNISCRIBE', 1)
Chun-wei Fan838346c2020-03-13 18:01:17 +0800243 conf.set('HAVE_GDI', 1)
Tim-Philipp Müllerb7796a52018-11-12 16:56:56 +0000244 endif
245endif
246
Ebrahim Byagowiddb103e2020-07-06 22:27:39 +0430247# DirectWrite (Windows)
Tim-Philipp Müller83ebbe42018-11-12 16:56:56 +0000248if host_machine.system() == 'windows' and not get_option('directwrite').disabled()
Ebrahim Byagowi24b42002020-08-13 09:06:39 +0430249 if get_option('directwrite').enabled() and not cpp.has_header('dwrite_1.h')
250 error('DirectWrite was enabled explicitly, but required header is missing.')
251 endif
252
Cameron Cawley6ea6c582021-09-24 22:05:29 +0100253 conf.set('HAVE_DIRECTWRITE', 1)
Tim-Philipp Müller83ebbe42018-11-12 16:56:56 +0000254endif
255
Ebrahim Byagowi52199342020-07-06 16:30:59 +0430256# CoreText (macOS)
Christoph Reiter03bd6ea2020-06-03 23:52:10 +0200257coretext_deps = []
Tim-Philipp Müller4840c822018-11-12 16:56:56 +0000258if host_machine.system() == 'darwin' and not get_option('coretext').disabled()
Ebrahim Byagowi62de2f72020-06-11 19:09:24 +0430259 app_services_dep = dependency('appleframeworks', modules: ['ApplicationServices'], required: false)
Tim-Philipp Müller4840c822018-11-12 16:56:56 +0000260 if cpp.has_type('CTFontRef', prefix: '#include <ApplicationServices/ApplicationServices.h>', dependencies: app_services_dep)
Christoph Reiter03bd6ea2020-06-03 23:52:10 +0200261 coretext_deps += [app_services_dep]
Tim-Philipp Müller4840c822018-11-12 16:56:56 +0000262 conf.set('HAVE_CORETEXT', 1)
263 # On iOS CoreText and CoreGraphics are stand-alone frameworks
264 # Check for a different symbol to avoid getting cached result
265 else
Ebrahim Byagowi62de2f72020-06-11 19:09:24 +0430266 coretext_dep = dependency('appleframeworks', modules: ['CoreText'], required: false)
267 coregraphics_dep = dependency('appleframeworks', modules: ['CoreGraphics'], required: false)
268 corefoundation_dep = dependency('appleframeworks', modules: ['CoreFoundation'], required: false)
Tim-Philipp Müller4840c822018-11-12 16:56:56 +0000269 if cpp.has_type('CTRunRef', prefix: '#include <CoreText/CoreText.h>', dependencies: [coretext_dep, coregraphics_dep, corefoundation_dep])
Christoph Reiter03bd6ea2020-06-03 23:52:10 +0200270 coretext_deps += [coretext_dep, coregraphics_dep, corefoundation_dep]
Tim-Philipp Müller4840c822018-11-12 16:56:56 +0000271 conf.set('HAVE_CORETEXT', 1)
272 elif get_option('coretext').enabled()
273 error('CoreText was enabled explicitly, but required headers or frameworks are missing.')
274 endif
275 endif
276endif
277
Tim-Philipp Müllerb7796a52018-11-12 16:56:56 +0000278# threads
Ebrahim Byagowif2a80ab2020-07-03 04:28:08 +0430279thread_dep = null_dep
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200280if host_machine.system() != 'windows'
281 thread_dep = dependency('threads', required: false)
282
283 if thread_dep.found()
284 conf.set('HAVE_PTHREAD', 1)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200285 endif
286endif
287
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200288conf.set_quoted('PACKAGE_NAME', 'HarfBuzz')
289conf.set_quoted('PACKAGE_VERSION', meson.project_version())
290
291foreach check : check_headers
292 name = check[0]
293
294 if cpp.has_header(name)
295 conf.set('HAVE_@0@'.format(name.to_upper().underscorify()), 1)
296 endif
297endforeach
298
Christoph Reiter03bd6ea2020-06-03 23:52:10 +0200299harfbuzz_extra_deps = []
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200300foreach check : check_funcs
301 name = check[0]
Mathieu Duponchelle04bcdb92018-06-05 20:59:29 +0200302 opts = check.get(1, {})
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200303 link_withs = opts.get('link_with', [])
Mathieu Duponchelle04bcdb92018-06-05 20:59:29 +0200304 check_deps = opts.get('deps', [])
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200305 extra_deps = []
306 found = true
307
308 # First try without linking
Mathieu Duponchelle04bcdb92018-06-05 20:59:29 +0200309 found = cpp.has_function(name, dependencies: check_deps)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200310
311 if not found and link_withs.length() > 0
312 found = true
313
314 foreach link_with : link_withs
315 dep = cpp.find_library(link_with, required: false)
316 if dep.found()
Ebrahim Byagowie8808c12020-03-24 19:15:09 +0430317 extra_deps += dep
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200318 else
Ebrahim Byagowie8808c12020-03-24 19:15:09 +0430319 found = false
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200320 endif
321 endforeach
322
323 if found
Mathieu Duponchelle04bcdb92018-06-05 20:59:29 +0200324 found = cpp.has_function(name, dependencies: check_deps + extra_deps)
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200325 endif
326 endif
327
328 if found
Christoph Reiter03bd6ea2020-06-03 23:52:10 +0200329 harfbuzz_extra_deps += extra_deps
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200330 conf.set('HAVE_@0@'.format(name.to_upper()), 1)
331 endif
332endforeach
333
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200334subdir('src')
335subdir('util')
Tim-Philipp Müller6147df32018-11-14 10:12:40 +0000336
337if not get_option('tests').disabled()
338 subdir('test')
339endif
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200340
Khaled Hosny68d2e1b2021-01-21 14:39:19 +0200341if not get_option('benchmark').disabled()
342 subdir('perf')
Ebrahim Byagowi95b10812020-06-09 17:37:36 +0430343endif
344
Ebrahim Byagowif9ac6dd2020-07-22 17:53:04 +0430345if not get_option('docs').disabled()
Tim-Philipp Müller3dd7b212020-05-17 00:12:08 +0100346 subdir('docs')
347endif
348
Mathieu Duponchelle920efc02018-05-17 01:28:53 +0200349configure_file(output: 'config.h', configuration: conf)
Ebrahim Byagowia9e83282020-05-21 16:28:24 +0430350
Ebrahim Byagowi58209c82020-08-12 23:04:26 +0430351build_summary = {
352 'Directories':
353 {'prefix': get_option('prefix'),
354 'bindir': get_option('bindir'),
355 'libdir': get_option('libdir'),
356 'includedir': get_option('includedir'),
357 'datadir': get_option('datadir'),
358 },
359 'Unicode callbacks (you want at least one)':
360 {'Builtin': true,
361 'Glib': conf.get('HAVE_GLIB', 0) == 1,
362 'ICU': conf.get('HAVE_ICU', 0) == 1,
363 },
364 'Font callbacks (the more the merrier)':
365 {'FreeType': conf.get('HAVE_FREETYPE', 0) == 1,
366 },
367 'Dependencies used for command-line utilities':
368 {'Cairo': conf.get('HAVE_CAIRO', 0) == 1,
Hans Petter Jansson8298c2f2021-04-23 18:37:58 +0200369 'Chafa': conf.get('HAVE_CHAFA', 0) == 1,
Ebrahim Byagowi58209c82020-08-12 23:04:26 +0430370 },
371 'Additional shapers':
372 {'Graphite2': conf.get('HAVE_GRAPHITE2', 0) == 1,
373 },
374 'Platform shapers (not normally needed)':
375 {'CoreText': conf.get('HAVE_CORETEXT', 0) == 1,
376 'DirectWrite': conf.get('HAVE_DIRECTWRITE', 0) == 1,
377 'GDI/Uniscribe': (conf.get('HAVE_GDI', 0) == 1) and (conf.get('HAVE_UNISCRIBE', 0) == 1),
378 },
379 'Other features':
380 {'Documentation': conf.get('HAVE_GTK_DOC', 0) == 1,
381 'GObject bindings': conf.get('HAVE_GOBJECT', 0) == 1,
382 'Introspection': conf.get('HAVE_INTROSPECTION', 0) == 1,
Khaled Hosnyb6f47af2021-01-21 14:34:01 +0200383 'Experimental APIs': conf.get('HB_EXPERIMENTAL_API', 0) == 1,
384 },
385 'Testing':
386 {'Tests': get_option('tests').enabled(),
387 'Benchmark': get_option('benchmark').enabled(),
Ebrahim Byagowi58209c82020-08-12 23:04:26 +0430388 },
389}
390if meson.version().version_compare('>=0.53')
391 foreach section_title, section : build_summary
392 summary(section, bool_yn: true, section: section_title)
393 endforeach
394else
395 summary = ['']
396 foreach section_title, section : build_summary
397 summary += ' @0@:'.format(section_title)
398 foreach feature, value : section
399 summary += ' @0@:'.format(feature)
400 summary += ' @0@'.format(value)
401 endforeach
402 summary += ''
403 endforeach
404 message('\n'.join(summary))
405endif