1 configure_file(input : 'glibconfig.h.in', output : 'glibconfig.h',
3 install_dir : join_paths(get_option('libdir'), 'glib-2.0/include'),
4 configuration : glibconfig_conf)
10 if have_good_vsnprintf and have_good_snprintf
21 install_headers(glib_headers, subdir : 'glib-2.0')
23 glib_deprecated_headers = files(
24 'deprecated/gallocator.h',
25 'deprecated/gcache.h',
26 'deprecated/gcompletion.h',
29 'deprecated/gthread.h',
31 install_headers(glib_deprecated_headers, subdir : 'glib-2.0/glib/deprecated')
33 glib_sub_headers = files(
34 'glib-autocleanups.h',
109 install_headers(glib_sub_headers, subdir : 'glib-2.0/glib')
111 deprecated_sources = files(
112 'deprecated/gallocator.c',
113 'deprecated/gcache.c',
114 'deprecated/gcompletion.c',
116 'deprecated/gthread-deprecated.c'
119 glib_sources = files(
191 'gvariant-serialiser.c',
192 'gvarianttypeinfo.c',
199 if host_system == 'windows'
200 glib_sources += files('gthread-win32.c')
201 glib_sources += files('gwin32.c', 'gspawn-win32.c', 'giowin32.c')
202 platform_deps = [winsock2, cc.find_library('winmm')]
204 glib_sources += files('gthread-posix.c')
205 glib_sources += files('glib-unix.c', 'gspawn.c', 'giounix.c')
210 glib_dtrace_obj = dtrace_obj_gen.process('glib_probes.d')
211 glib_dtrace_hdr = dtrace_hdr_gen.process('glib_probes.d')
217 pcre_static_args = []
219 if use_pcre_static_flag
220 pcre_static_args = ['-DPCRE_STATIC']
223 libglib = shared_library('glib-2.0',
224 glib_dtrace_obj, glib_dtrace_hdr,
225 sources : [deprecated_sources, glib_sources],
226 version : library_version,
227 soversion : soversion,
229 # intl.lib is not compatible with SAFESEH
230 link_args : platform_ldflags + noseh_link_args,
231 include_directories : configinc,
232 link_with : [charset_lib, gnulib_lib],
233 dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps,
234 c_args : ['-DG_LOG_DOMAIN="GLib"', '-DGLIB_COMPILATION'] + pcre_static_args + glib_hidden_visibility_args
237 libglib_dep = declare_dependency(link_with : libglib,
238 # We sadly need to export configinc here because everyone includes <glib/*.h>
239 include_directories : [configinc, glibinc])
241 # On Windows, glib needs a spawn helper for g_spawn* API
242 if host_system == 'windows'
243 if host_machine.cpu_family() == 'x86'
244 executable('gspawn-win32-helper', 'gspawn-win32-helper.c',
247 c_args : ['-DHAVE_CONFIG_H=1'],
248 include_directories : configinc,
249 dependencies : [libintl, libglib_dep])
250 executable('gspawn-win32-helper-console', 'gspawn-win32-helper.c',
252 c_args : ['-DHAVE_CONFIG_H=1', '-DHELPER_CONSOLE'],
253 include_directories : configinc,
254 dependencies : [libintl, libglib_dep])
256 executable('gspawn-win64-helper', 'gspawn-win32-helper.c',
259 c_args : ['-DHAVE_CONFIG_H=1'],
260 include_directories : configinc,
261 dependencies : [libintl, libglib_dep])
262 executable('gspawn-win64-helper-console', 'gspawn-win32-helper.c',
264 c_args : ['-DHAVE_CONFIG_H=1', '-DHELPER_CONSOLE'],
265 include_directories : configinc,
266 dependencies : [libintl, libglib_dep])
269 gtester = executable('gtester', 'gtester.c',
271 c_args : ['-DHAVE_CONFIG_H=1'],
272 include_directories : configinc,
273 dependencies : [libglib_dep])
276 install_data('gtester-report', install_dir : get_option('bindir'))
278 install_data('glib_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb'))
280 gdb_conf = configuration_data()
281 gdb_conf.set('datadir', glib_datadir)
282 # This is also used in gobject/meson.build
283 if host_system != 'windows'
284 # XXX: We add a leading './' because glib_libdir is an absolute path and we
285 # need it to be a relative path so that join_paths appends it to the end.
286 gdb_install_dir = join_paths(glib_datadir, 'gdb', 'auto-load', './' + glib_libdir)
288 # FIXME: Cannot install on Windows because the path will contain a drive
289 # letter and colons are not allowed in paths.
290 gdb_install_dir = false
293 input: 'libglib-gdb.py.in',
294 output: 'libglib-2.0.so.@0@-gdb.py'.format(library_version),
295 configuration: gdb_conf,
296 install_dir: gdb_install_dir,
300 glib_stp = configure_file(input : 'glib.stp.in',
301 output : '@0@.stp'.format(libglib.full_path().split('/').get(-1)),
302 configuration : stp_cdata,
303 install_dir : tapset_install_dir,
307 # gtester doesn't work on native windows
308 if cc.get_id() != 'msvc'