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 = [
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')
34 'glib-autocleanups.h',
109 install_headers(glib_sub_headers, subdir : 'glib-2.0/glib')
111 deprecated_sources = [
112 'deprecated/gallocator.c',
113 'deprecated/gcache.c',
114 'deprecated/gcompletion.c',
116 'deprecated/gthread-deprecated.c'
190 'gvariant-serialiser.c',
191 'gvarianttypeinfo.c',
198 if host_system == 'windows'
199 thread_src = ['gthread-win32.c']
200 plat_src = ['gwin32.c', 'gspawn-win32.c', 'giowin32.c']
201 platform_deps = [winsock2, cc.find_library('winmm')]
203 thread_src = ['gthread-posix.c']
204 plat_src = ['glib-unix.c', 'gspawn.c', 'giounix.c']
209 glib_dtrace_obj = dtrace_obj_gen.process('glib_probes.d')
210 glib_dtrace_hdr = dtrace_hdr_gen.process('glib_probes.d')
216 pcre_static_args = []
218 if use_pcre_static_flag
219 pcre_static_args = ['-DPCRE_STATIC']
222 libglib = shared_library('glib-2.0',
223 glib_dtrace_obj, glib_dtrace_hdr,
224 sources : [deprecated_sources, glib_sources, thread_src, plat_src],
225 version : library_version,
226 soversion : soversion,
228 # intl.lib is not compatible with SAFESEH
229 link_args : noseh_link_args,
230 include_directories : configinc,
231 link_with : [charset_lib, gnulib_lib],
232 dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps,
233 c_args : ['-DG_LOG_DOMAIN="GLib"', '-DGLIB_COMPILATION'] + pcre_static_args + glib_hidden_visibility_args
236 libglib_dep = declare_dependency(link_with : libglib,
237 # We sadly need to export configinc here because everyone includes <glib/*.h>
238 include_directories : [configinc, glibinc])
240 # On Windows, glib needs a spawn helper for g_spawn* API
241 if host_system == 'windows'
242 if host_machine.cpu_family() == 'x86'
243 executable('gspawn-win32-helper', 'gspawn-win32-helper.c',
246 c_args : ['-DHAVE_CONFIG_H=1'],
247 include_directories : configinc,
248 dependencies : [libintl, libglib_dep])
249 executable('gspawn-win32-helper-console', 'gspawn-win32-helper.c',
251 c_args : ['-DHAVE_CONFIG_H=1', '-DHELPER_CONSOLE'],
252 include_directories : configinc,
253 dependencies : [libintl, libglib_dep])
255 executable('gspawn-win64-helper', 'gspawn-win32-helper.c',
258 c_args : ['-DHAVE_CONFIG_H=1'],
259 include_directories : configinc,
260 dependencies : [libintl, libglib_dep])
261 executable('gspawn-win64-helper-console', 'gspawn-win32-helper.c',
263 c_args : ['-DHAVE_CONFIG_H=1', '-DHELPER_CONSOLE'],
264 include_directories : configinc,
265 dependencies : [libintl, libglib_dep])
268 gtester = executable('gtester', 'gtester.c',
270 c_args : ['-DHAVE_CONFIG_H=1'],
271 include_directories : configinc,
272 dependencies : [libglib_dep])
275 install_data('gtester-report', install_dir : get_option('bindir'))
276 install_data('glib_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb'))
278 gdb_conf = configuration_data()
279 gdb_conf.set('datadir', glib_datadir)
281 input: 'libglib-gdb.py.in',
282 output: 'libglib-2.0.so.@0@-gdb.py'.format(library_version),
283 configuration: gdb_conf,
285 install_dir: join_paths(get_option('datadir'), 'gdb/auto-load' + glib_libdir)
289 glib_stp = configure_file(input : 'glib.stp.in',
290 output : '@0@.stp'.format(libglib.full_path().split('/').get(-1)),
291 configuration : stp_cdata,
292 install_dir : tapset_install_dir,
296 # gtester doesn't work on native windows
297 if cc.get_id() != 'msvc'