2022-10-20 00:27:53 +02:00
|
|
|
glib_sources = []
|
2022-10-24 14:13:04 +02:00
|
|
|
glib_sub_includedir = glib_includedir / 'glib'
|
2022-10-20 00:27:53 +02:00
|
|
|
|
2022-01-28 14:54:22 +01:00
|
|
|
glibconfig_h = configure_file(input : 'glibconfig.h.in', output : 'glibconfig.h',
|
2016-12-09 20:30:22 +01:00
|
|
|
install_dir : join_paths(get_option('libdir'), 'glib-2.0/include'),
|
2022-09-18 22:51:55 +02:00
|
|
|
install_tag : 'devel',
|
2016-12-20 23:37:24 +01:00
|
|
|
configuration : glibconfig_conf)
|
2022-10-20 16:47:13 +02:00
|
|
|
glib_sources += glibconfig_h
|
2013-08-07 22:41:12 +02:00
|
|
|
|
2022-10-20 00:27:53 +02:00
|
|
|
gversionmacros_h = custom_target(
|
2022-10-03 16:36:04 +02:00
|
|
|
input: 'gversionmacros.h.in',
|
|
|
|
output: 'gversionmacros.h',
|
|
|
|
command: [gen_visibility_macros, meson.project_version(), 'versions-macros', '@INPUT@', '@OUTPUT@'],
|
2022-10-20 00:27:53 +02:00
|
|
|
install: true,
|
2022-10-26 13:01:51 +02:00
|
|
|
install_dir: glib_sub_includedir,
|
2022-10-26 17:38:10 +02:00
|
|
|
# FIXME: Not needed with Meson >= 0.64.0
|
2022-10-26 13:01:51 +02:00
|
|
|
install_tag: 'devel',
|
2022-10-03 16:36:04 +02:00
|
|
|
)
|
|
|
|
|
2022-10-20 00:27:53 +02:00
|
|
|
gvisibility_h = custom_target(
|
2022-10-03 16:36:04 +02:00
|
|
|
output: 'glib-visibility.h',
|
|
|
|
command: [gen_visibility_macros, meson.project_version(), 'visibility-macros', 'GLIB', '@OUTPUT@'],
|
2022-10-20 00:27:53 +02:00
|
|
|
install: true,
|
2022-10-24 14:13:04 +02:00
|
|
|
install_dir: glib_sub_includedir,
|
2022-10-26 17:38:10 +02:00
|
|
|
# FIXME: Not needed with Meson >= 0.64.0
|
2022-10-26 13:01:51 +02:00
|
|
|
install_tag: 'devel',
|
2022-10-03 16:36:04 +02:00
|
|
|
)
|
|
|
|
|
2022-10-20 00:27:53 +02:00
|
|
|
glib_built_headers = [gversionmacros_h, gvisibility_h]
|
|
|
|
glib_sources += glib_built_headers
|
2022-10-03 16:36:04 +02:00
|
|
|
glib_c_args_internal = [
|
|
|
|
'-DGLIB_COMPILATION',
|
|
|
|
]
|
|
|
|
|
2013-08-07 22:41:12 +02:00
|
|
|
subdir('libcharset')
|
2018-09-25 09:58:25 +02:00
|
|
|
|
2020-06-25 23:08:05 +02:00
|
|
|
# libsysprof-capture support
|
2020-10-09 00:29:39 +02:00
|
|
|
libsysprof_capture_dep = dependency('sysprof-capture-4', version: '>= 3.38.0',
|
2020-06-25 23:08:05 +02:00
|
|
|
required: get_option('sysprof'),
|
|
|
|
default_options: [
|
2022-05-26 08:02:14 +02:00
|
|
|
'examples=false',
|
|
|
|
'gtk=false',
|
|
|
|
'tests=false',
|
|
|
|
'tools=false',
|
2020-06-25 23:08:05 +02:00
|
|
|
'libsysprof=false',
|
2022-05-26 08:02:14 +02:00
|
|
|
'sysprofd=none',
|
2020-06-25 23:08:05 +02:00
|
|
|
'help=false',
|
|
|
|
],
|
|
|
|
fallback: ['sysprof', 'libsysprof_capture_dep'],
|
|
|
|
)
|
|
|
|
glib_conf.set('HAVE_SYSPROF', libsysprof_capture_dep.found())
|
|
|
|
|
2019-08-10 16:45:31 +02:00
|
|
|
if use_system_printf
|
2017-07-17 09:51:54 +02:00
|
|
|
gnulib_lib = []
|
2019-02-09 15:06:03 +01:00
|
|
|
gnulib_libm_dependency = []
|
|
|
|
glib_conf.set ('gl_unused', '')
|
|
|
|
glib_conf.set ('gl_extern_inline', '')
|
2017-07-17 09:51:54 +02:00
|
|
|
else
|
2019-02-09 15:06:03 +01:00
|
|
|
subdir ('gnulib/gl_extern_inline')
|
|
|
|
subdir ('gnulib/gl_cv_long_double_equals_double')
|
|
|
|
subdir ('gnulib/gl_cv_cc_double_expbit0')
|
|
|
|
subdir ('gnulib/gl_cv_func_printf_precision')
|
|
|
|
subdir ('gnulib/gl_cv_func_printf_enomem')
|
|
|
|
subdir ('gnulib/gl_cv_func_printf_flag_zero')
|
|
|
|
subdir ('gnulib/gl_cv_func_printf_flag_leftadjust')
|
|
|
|
subdir ('gnulib/gl_cv_func_printf_flag_grouping')
|
|
|
|
subdir ('gnulib/gl_cv_func_printf_directive_a')
|
|
|
|
subdir ('gnulib/gl_cv_func_printf_directive_f')
|
|
|
|
subdir ('gnulib/gl_cv_func_printf_directive_ls')
|
|
|
|
subdir ('gnulib/gl_cv_func_printf_long_double')
|
|
|
|
subdir ('gnulib/gl_cv_func_printf_infinite')
|
|
|
|
subdir ('gnulib/gl_cv_func_printf_infinite_long_double')
|
|
|
|
|
|
|
|
gl_unused = '''
|
|
|
|
/* Define as a marker that can be attached to declarations that might not
|
|
|
|
be used. This helps to reduce warnings, such as from
|
|
|
|
GCC -Wunused-parameter. */
|
|
|
|
#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
|
|
|
|
# define _GL_UNUSED __attribute__ ((__unused__))
|
|
|
|
#else
|
|
|
|
# define _GL_UNUSED
|
|
|
|
#endif
|
|
|
|
'''
|
|
|
|
glib_conf.set ('gl_unused', gl_unused)
|
|
|
|
glib_conf.set ('gl_extern_inline', gl_extern_inline)
|
|
|
|
|
|
|
|
if (gl_cv_long_double_equals_double)
|
|
|
|
glib_conf.set ('HAVE_SAME_LONG_DOUBLE_AS_DOUBLE', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if (gl_cv_cc_double_expbit0_word >= 0 and
|
|
|
|
gl_cv_cc_double_expbit0_bit >= 0)
|
|
|
|
glib_conf.set('DBL_EXPBIT0_WORD', gl_cv_cc_double_expbit0_word)
|
|
|
|
glib_conf.set('DBL_EXPBIT0_BIT', gl_cv_cc_double_expbit0_bit)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if not gl_cv_func_printf_precision
|
|
|
|
glib_conf.set('NEED_PRINTF_UNBOUNDED_PRECISION', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if not gl_cv_func_printf_enomem
|
|
|
|
glib_conf.set('NEED_PRINTF_ENOMEM', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if not gl_cv_func_printf_flag_leftadjust
|
|
|
|
glib_conf.set('NEED_PRINTF_FLAG_LEFTADJUST', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if not gl_cv_func_printf_flag_zero
|
|
|
|
glib_conf.set('NEED_PRINTF_FLAG_ZERO', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if not gl_cv_func_printf_flag_grouping
|
|
|
|
glib_conf.set('NEED_PRINTF_FLAG_GROUPING', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if not gl_cv_func_printf_directive_a
|
|
|
|
glib_conf.set('NEED_PRINTF_DIRECTIVE_A', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if not gl_cv_func_printf_directive_f
|
|
|
|
glib_conf.set('NEED_PRINTF_DIRECTIVE_F', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if not gl_cv_func_printf_directive_ls
|
|
|
|
glib_conf.set('NEED_PRINTF_DIRECTIVE_LS', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if (not gl_cv_func_printf_precision or
|
|
|
|
not gl_cv_func_printf_enomem)
|
|
|
|
glib_conf.set('NEED_PRINTF_DOUBLE', 1)
|
|
|
|
glib_conf.set('NEED_PRINTF_LONG_DOUBLE', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if not gl_cv_func_printf_infinite
|
|
|
|
glib_conf.set('NEED_PRINTF_INFINITE_DOUBLE', 1)
|
|
|
|
endif
|
|
|
|
|
2020-06-08 15:13:04 +02:00
|
|
|
if gl_cv_func_printf_long_double and gl_cv_func_printf_infinite_long_double
|
2019-02-09 15:06:03 +01:00
|
|
|
glib_conf.set('NEED_PRINTF_INFINITE_LONG_DOUBLE', 1)
|
|
|
|
endif
|
|
|
|
|
2017-07-17 09:51:54 +02:00
|
|
|
subdir('gnulib')
|
|
|
|
endif
|
2013-08-07 22:41:12 +02:00
|
|
|
|
2017-11-22 09:41:11 +01:00
|
|
|
glib_headers = files(
|
2016-03-07 12:13:24 +01:00
|
|
|
'glib.h',
|
|
|
|
'glib-unix.h',
|
|
|
|
'glib-object.h',
|
2017-11-22 09:41:11 +01:00
|
|
|
)
|
2022-10-24 14:13:04 +02:00
|
|
|
install_headers(glib_headers, install_dir : glib_includedir)
|
2016-03-07 12:13:24 +01:00
|
|
|
|
2022-01-28 14:54:22 +01:00
|
|
|
# Expose as variable to be used by gobject-introspection
|
|
|
|
# when it includes GLib as a subproject
|
|
|
|
glib_unix_h = files('glib-unix.h')
|
|
|
|
|
2017-11-22 09:41:11 +01:00
|
|
|
glib_deprecated_headers = files(
|
2016-03-07 12:13:24 +01:00
|
|
|
'deprecated/gallocator.h',
|
|
|
|
'deprecated/gcache.h',
|
|
|
|
'deprecated/gcompletion.h',
|
|
|
|
'deprecated/gmain.h',
|
|
|
|
'deprecated/grel.h',
|
|
|
|
'deprecated/gthread.h',
|
2017-11-22 09:41:11 +01:00
|
|
|
)
|
2022-10-24 14:13:04 +02:00
|
|
|
install_headers(glib_deprecated_headers,
|
|
|
|
install_dir : glib_sub_includedir / 'deprecated')
|
2016-03-07 12:13:24 +01:00
|
|
|
|
2017-11-22 09:41:11 +01:00
|
|
|
glib_sub_headers = files(
|
2016-03-07 12:13:24 +01:00
|
|
|
'glib-autocleanups.h',
|
2021-02-26 21:15:57 +01:00
|
|
|
'glib-typeof.h',
|
2016-03-07 12:13:24 +01:00
|
|
|
'galloca.h',
|
|
|
|
'garray.h',
|
|
|
|
'gasyncqueue.h',
|
|
|
|
'gatomic.h',
|
|
|
|
'gbacktrace.h',
|
|
|
|
'gbase64.h',
|
|
|
|
'gbitlock.h',
|
|
|
|
'gbookmarkfile.h',
|
|
|
|
'gbytes.h',
|
|
|
|
'gcharset.h',
|
|
|
|
'gchecksum.h',
|
|
|
|
'gconvert.h',
|
|
|
|
'gdataset.h',
|
|
|
|
'gdate.h',
|
|
|
|
'gdatetime.h',
|
|
|
|
'gdir.h',
|
|
|
|
'genviron.h',
|
|
|
|
'gerror.h',
|
|
|
|
'gfileutils.h',
|
|
|
|
'ggettext.h',
|
|
|
|
'ghash.h',
|
|
|
|
'ghmac.h',
|
|
|
|
'ghook.h',
|
|
|
|
'ghostutils.h',
|
|
|
|
'gi18n.h',
|
|
|
|
'gi18n-lib.h',
|
|
|
|
'giochannel.h',
|
|
|
|
'gkeyfile.h',
|
|
|
|
'glist.h',
|
|
|
|
'gmacros.h',
|
|
|
|
'gmain.h',
|
|
|
|
'gmappedfile.h',
|
|
|
|
'gmarkup.h',
|
|
|
|
'gmem.h',
|
|
|
|
'gmessages.h',
|
|
|
|
'gnode.h',
|
|
|
|
'goption.h',
|
|
|
|
'gpattern.h',
|
|
|
|
'gpoll.h',
|
|
|
|
'gprimes.h',
|
|
|
|
'gqsort.h',
|
|
|
|
'gquark.h',
|
|
|
|
'gqueue.h',
|
|
|
|
'grand.h',
|
2018-06-10 13:20:34 +02:00
|
|
|
'grcbox.h',
|
2018-01-17 17:38:45 +01:00
|
|
|
'grefcount.h',
|
2018-06-12 14:46:28 +02:00
|
|
|
'grefstring.h',
|
2016-03-07 12:13:24 +01:00
|
|
|
'gregex.h',
|
|
|
|
'gscanner.h',
|
|
|
|
'gsequence.h',
|
|
|
|
'gshell.h',
|
|
|
|
'gslice.h',
|
|
|
|
'gslist.h',
|
|
|
|
'gspawn.h',
|
|
|
|
'gstdio.h',
|
|
|
|
'gstrfuncs.h',
|
2020-10-14 13:01:24 +02:00
|
|
|
'gstrvbuilder.h',
|
2016-03-07 12:13:24 +01:00
|
|
|
'gtestutils.h',
|
|
|
|
'gstring.h',
|
|
|
|
'gstringchunk.h',
|
|
|
|
'gthread.h',
|
|
|
|
'gthreadpool.h',
|
|
|
|
'gtimer.h',
|
|
|
|
'gtimezone.h',
|
|
|
|
'gtrashstack.h',
|
|
|
|
'gtree.h',
|
|
|
|
'gtypes.h',
|
2017-05-22 12:07:19 +02:00
|
|
|
'guuid.h',
|
2016-03-07 12:13:24 +01:00
|
|
|
'gunicode.h',
|
2019-01-17 07:38:20 +01:00
|
|
|
'guri.h',
|
2016-03-07 12:13:24 +01:00
|
|
|
'gutils.h',
|
|
|
|
'gvarianttype.h',
|
|
|
|
'gvariant.h',
|
|
|
|
'gversion.h',
|
|
|
|
'gwin32.h',
|
|
|
|
'gprintf.h',
|
2017-11-22 09:41:11 +01:00
|
|
|
)
|
2022-10-03 16:36:04 +02:00
|
|
|
|
2022-10-24 14:13:04 +02:00
|
|
|
install_headers(glib_sub_headers, install_dir : glib_sub_includedir)
|
2016-03-07 12:13:24 +01:00
|
|
|
|
2017-11-22 09:41:11 +01:00
|
|
|
deprecated_sources = files(
|
2016-12-09 20:30:22 +01:00
|
|
|
'deprecated/gallocator.c',
|
|
|
|
'deprecated/gcache.c',
|
|
|
|
'deprecated/gcompletion.c',
|
|
|
|
'deprecated/grel.c',
|
|
|
|
'deprecated/gthread-deprecated.c'
|
2017-11-22 09:41:11 +01:00
|
|
|
)
|
2013-08-07 22:41:12 +02:00
|
|
|
|
2022-10-20 00:27:53 +02:00
|
|
|
glib_sources += files(
|
2018-06-11 12:52:54 +02:00
|
|
|
'garcbox.c',
|
2016-12-09 20:30:22 +01:00
|
|
|
'garray.c',
|
|
|
|
'gasyncqueue.c',
|
|
|
|
'gatomic.c',
|
|
|
|
'gbacktrace.c',
|
|
|
|
'gbase64.c',
|
|
|
|
'gbitlock.c',
|
|
|
|
'gbookmarkfile.c',
|
|
|
|
'gbytes.c',
|
|
|
|
'gcharset.c',
|
|
|
|
'gchecksum.c',
|
|
|
|
'gconvert.c',
|
|
|
|
'gdataset.c',
|
|
|
|
'gdate.c',
|
|
|
|
'gdatetime.c',
|
|
|
|
'gdir.c',
|
|
|
|
'genviron.c',
|
|
|
|
'gerror.c',
|
|
|
|
'gfileutils.c',
|
|
|
|
'ggettext.c',
|
|
|
|
'ghash.c',
|
|
|
|
'ghmac.c',
|
|
|
|
'ghook.c',
|
|
|
|
'ghostutils.c',
|
|
|
|
'giochannel.c',
|
|
|
|
'gkeyfile.c',
|
|
|
|
'glib-init.c',
|
|
|
|
'glib-private.c',
|
|
|
|
'glist.c',
|
|
|
|
'gmain.c',
|
|
|
|
'gmappedfile.c',
|
|
|
|
'gmarkup.c',
|
|
|
|
'gmem.c',
|
|
|
|
'gmessages.c',
|
|
|
|
'gnode.c',
|
|
|
|
'goption.c',
|
|
|
|
'gpattern.c',
|
|
|
|
'gpoll.c',
|
|
|
|
'gprimes.c',
|
|
|
|
'gqsort.c',
|
|
|
|
'gquark.c',
|
|
|
|
'gqueue.c',
|
|
|
|
'grand.c',
|
2018-06-10 13:20:34 +02:00
|
|
|
'grcbox.c',
|
2018-01-17 17:38:45 +01:00
|
|
|
'grefcount.c',
|
2018-06-12 14:46:28 +02:00
|
|
|
'grefstring.c',
|
2016-12-09 20:30:22 +01:00
|
|
|
'gregex.c',
|
|
|
|
'gscanner.c',
|
|
|
|
'gsequence.c',
|
|
|
|
'gshell.c',
|
|
|
|
'gslice.c',
|
|
|
|
'gslist.c',
|
|
|
|
'gstdio.c',
|
|
|
|
'gstrfuncs.c',
|
|
|
|
'gstring.c',
|
|
|
|
'gstringchunk.c',
|
2020-10-14 13:01:24 +02:00
|
|
|
'gstrvbuilder.c',
|
2016-12-09 20:30:22 +01:00
|
|
|
'gtestutils.c',
|
|
|
|
'gthread.c',
|
|
|
|
'gthreadpool.c',
|
|
|
|
'gtimer.c',
|
|
|
|
'gtimezone.c',
|
2020-06-25 23:08:05 +02:00
|
|
|
'gtrace.c',
|
|
|
|
'gtrace-private.h',
|
2016-12-09 20:30:22 +01:00
|
|
|
'gtranslit.c',
|
|
|
|
'gtrashstack.c',
|
|
|
|
'gtree.c',
|
|
|
|
'guniprop.c',
|
|
|
|
'gutf8.c',
|
|
|
|
'gunibreak.c',
|
|
|
|
'gunicollate.c',
|
|
|
|
'gunidecomp.c',
|
2019-01-17 07:38:20 +01:00
|
|
|
'guri.c',
|
|
|
|
'guriprivate.h',
|
2016-12-09 20:30:22 +01:00
|
|
|
'gutils.c',
|
2018-11-30 18:47:18 +01:00
|
|
|
'gutilsprivate.h',
|
2017-08-25 17:05:03 +02:00
|
|
|
'guuid.c',
|
2016-12-09 20:30:22 +01:00
|
|
|
'gvariant.c',
|
|
|
|
'gvariant-core.c',
|
|
|
|
'gvariant-parser.c',
|
|
|
|
'gvariant-serialiser.c',
|
|
|
|
'gvarianttypeinfo.c',
|
|
|
|
'gvarianttype.c',
|
|
|
|
'gversion.c',
|
|
|
|
'gwakeup.c',
|
|
|
|
'gprintf.c',
|
2017-11-22 09:41:11 +01:00
|
|
|
)
|
2013-08-07 22:41:12 +02:00
|
|
|
|
2021-12-31 18:31:00 +01:00
|
|
|
platform_deps = []
|
|
|
|
|
2016-12-20 23:37:24 +01:00
|
|
|
if host_system == 'windows'
|
2022-10-20 00:51:34 +02:00
|
|
|
if glib_build_shared
|
2022-01-26 15:46:38 +01:00
|
|
|
glib_win_rc = configure_file(
|
|
|
|
input: 'glib.rc.in',
|
|
|
|
output: 'glib.rc',
|
|
|
|
configuration: glibconfig_conf,
|
|
|
|
)
|
|
|
|
glib_win_res = windows.compile_resources(glib_win_rc)
|
|
|
|
glib_sources += [glib_win_res]
|
|
|
|
endif
|
2017-11-22 09:41:11 +01:00
|
|
|
glib_sources += files('gwin32.c', 'gspawn-win32.c', 'giowin32.c')
|
2016-12-20 23:37:24 +01:00
|
|
|
platform_deps = [winsock2, cc.find_library('winmm')]
|
2019-07-09 18:22:51 +02:00
|
|
|
if cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl'
|
2019-01-16 16:24:11 +01:00
|
|
|
glib_sources += files('dirent/wdirent.c')
|
|
|
|
endif
|
2016-12-20 23:37:24 +01:00
|
|
|
else
|
2017-11-22 09:41:11 +01:00
|
|
|
glib_sources += files('glib-unix.c', 'gspawn.c', 'giounix.c')
|
2016-12-20 23:37:24 +01:00
|
|
|
platform_deps = []
|
|
|
|
endif
|
|
|
|
|
2022-07-14 15:30:02 +02:00
|
|
|
if host_system == 'linux'
|
|
|
|
glib_sources += files('gjournal-private.c')
|
|
|
|
endif
|
|
|
|
|
2020-04-01 08:32:26 +02:00
|
|
|
if glib_have_cocoa
|
2019-01-28 15:27:40 +01:00
|
|
|
glib_sources += files('gosxutils.m')
|
2021-12-31 18:31:00 +01:00
|
|
|
framework_dep = dependency('appleframeworks', modules : ['Foundation', 'CoreFoundation', 'AppKit'])
|
|
|
|
platform_deps += [framework_dep]
|
|
|
|
endif
|
|
|
|
|
|
|
|
if glib_have_carbon
|
|
|
|
framework_dep = dependency('appleframeworks', modules : 'Carbon')
|
|
|
|
platform_deps += [framework_dep]
|
2019-01-28 15:27:40 +01:00
|
|
|
endif
|
|
|
|
|
2018-05-15 20:05:50 +02:00
|
|
|
glib_sources += files('gthread-@0@.c'.format(threads_implementation))
|
|
|
|
|
2017-01-25 18:02:51 +01:00
|
|
|
if enable_dtrace
|
|
|
|
glib_dtrace_obj = dtrace_obj_gen.process('glib_probes.d')
|
|
|
|
glib_dtrace_hdr = dtrace_hdr_gen.process('glib_probes.d')
|
|
|
|
else
|
|
|
|
glib_dtrace_obj = []
|
|
|
|
glib_dtrace_hdr = []
|
|
|
|
endif
|
|
|
|
|
2022-07-12 13:46:34 +02:00
|
|
|
pcre2_static_args = []
|
2017-07-25 10:28:29 +02:00
|
|
|
|
2022-07-12 13:46:34 +02:00
|
|
|
if use_pcre2_static_flag
|
|
|
|
pcre2_static_args = ['-DPCRE2_STATIC']
|
2017-07-25 10:28:29 +02:00
|
|
|
endif
|
|
|
|
|
2022-10-03 16:36:04 +02:00
|
|
|
glib_c_args = ['-DG_LOG_DOMAIN="GLib"'] + glib_c_args_internal + pcre2_static_args
|
2017-07-16 16:41:02 +02:00
|
|
|
libglib = library('glib-2.0',
|
2017-01-25 18:02:51 +01:00
|
|
|
glib_dtrace_obj, glib_dtrace_hdr,
|
2017-11-22 09:41:11 +01:00
|
|
|
sources : [deprecated_sources, glib_sources],
|
2016-12-20 23:37:24 +01:00
|
|
|
version : library_version,
|
|
|
|
soversion : soversion,
|
2018-08-29 12:06:23 +02:00
|
|
|
darwin_versions : darwin_versions,
|
2016-12-20 23:37:24 +01:00
|
|
|
install : true,
|
|
|
|
# intl.lib is not compatible with SAFESEH
|
2018-05-15 21:17:28 +02:00
|
|
|
link_args : [noseh_link_args, glib_link_flags, win32_ldflags],
|
2016-12-20 23:37:24 +01:00
|
|
|
include_directories : configinc,
|
2021-10-06 22:56:54 +02:00
|
|
|
link_with: [charset_lib, gnulib_lib],
|
2022-10-21 14:09:49 +02:00
|
|
|
dependencies : [
|
|
|
|
gnulib_libm_dependency,
|
|
|
|
libiconv,
|
|
|
|
libintl_deps,
|
|
|
|
libm,
|
|
|
|
librt,
|
|
|
|
libsysprof_capture_dep,
|
|
|
|
pcre2,
|
|
|
|
platform_deps,
|
|
|
|
thread_dep,
|
|
|
|
],
|
2019-01-28 15:27:40 +01:00
|
|
|
c_args : glib_c_args,
|
|
|
|
objc_args : glib_c_args,
|
2022-10-03 16:36:04 +02:00
|
|
|
gnu_symbol_visibility : 'hidden',
|
2016-12-20 23:37:24 +01:00
|
|
|
)
|
2013-08-07 22:41:12 +02:00
|
|
|
|
2018-01-05 13:22:17 +01:00
|
|
|
libglib_dep = declare_dependency(
|
|
|
|
link_with : libglib,
|
2020-04-13 15:54:15 +02:00
|
|
|
dependencies : libintl_deps,
|
2022-10-20 00:27:53 +02:00
|
|
|
sources : glib_built_headers,
|
2016-12-20 23:37:24 +01:00
|
|
|
# We sadly need to export configinc here because everyone includes <glib/*.h>
|
|
|
|
include_directories : [configinc, glibinc])
|
2016-03-07 12:13:24 +01:00
|
|
|
|
2018-12-07 20:37:51 +01:00
|
|
|
pkg.generate(libglib,
|
2020-04-13 15:54:15 +02:00
|
|
|
libraries : [libintl_deps],
|
2021-12-31 18:31:00 +01:00
|
|
|
libraries_private : [win32_ldflags],
|
2017-12-11 20:47:04 +01:00
|
|
|
subdirs : ['glib-2.0'],
|
2018-05-15 21:17:28 +02:00
|
|
|
extra_cflags : ['-I${libdir}/glib-2.0/include'] + win32_cflags,
|
2022-11-24 13:10:03 +01:00
|
|
|
variables : ['bindir=' + join_paths('${prefix}', get_option('bindir')),
|
|
|
|
'glib_genmarshal=' + join_paths('${bindir}', 'glib-genmarshal'),
|
2017-12-11 20:47:04 +01:00
|
|
|
'gobject_query=' + join_paths('${bindir}', 'gobject-query'),
|
|
|
|
'glib_mkenums=' + join_paths('${bindir}', 'glib-mkenums')],
|
|
|
|
version : glib_version,
|
|
|
|
install_dir : glib_pkgconfigreldir,
|
|
|
|
filebase : 'glib-2.0',
|
|
|
|
name : 'GLib',
|
|
|
|
description : 'C Utility Library',
|
|
|
|
)
|
2022-05-05 20:24:30 +02:00
|
|
|
meson.override_dependency('glib-2.0', libglib_dep)
|
2020-04-05 06:34:04 +02:00
|
|
|
|
2016-12-20 23:37:24 +01:00
|
|
|
# On Windows, glib needs a spawn helper for g_spawn* API
|
|
|
|
if host_system == 'windows'
|
|
|
|
if host_machine.cpu_family() == 'x86'
|
|
|
|
executable('gspawn-win32-helper', 'gspawn-win32-helper.c',
|
|
|
|
install : true,
|
2022-05-06 14:16:26 +02:00
|
|
|
win_subsystem : 'windows',
|
2016-12-20 23:37:24 +01:00
|
|
|
include_directories : configinc,
|
2018-05-14 01:22:51 +02:00
|
|
|
dependencies : [libglib_dep])
|
2016-12-20 23:37:24 +01:00
|
|
|
executable('gspawn-win32-helper-console', 'gspawn-win32-helper.c',
|
|
|
|
install : true,
|
2018-02-19 13:09:10 +01:00
|
|
|
c_args : ['-DHELPER_CONSOLE'],
|
2016-12-20 23:37:24 +01:00
|
|
|
include_directories : configinc,
|
2018-05-14 01:22:51 +02:00
|
|
|
dependencies : [libglib_dep])
|
2016-12-20 23:37:24 +01:00
|
|
|
else
|
|
|
|
executable('gspawn-win64-helper', 'gspawn-win32-helper.c',
|
|
|
|
install : true,
|
2022-05-06 14:16:26 +02:00
|
|
|
win_subsystem : 'windows',
|
2016-12-20 23:37:24 +01:00
|
|
|
include_directories : configinc,
|
2018-05-14 01:22:51 +02:00
|
|
|
dependencies : [libglib_dep])
|
2016-12-20 23:37:24 +01:00
|
|
|
executable('gspawn-win64-helper-console', 'gspawn-win32-helper.c',
|
|
|
|
install : true,
|
2018-02-19 13:09:10 +01:00
|
|
|
c_args : ['-DHELPER_CONSOLE'],
|
2016-12-20 23:37:24 +01:00
|
|
|
include_directories : configinc,
|
2018-05-14 01:22:51 +02:00
|
|
|
dependencies : [libglib_dep])
|
2016-12-20 23:37:24 +01:00
|
|
|
endif
|
|
|
|
else
|
2017-01-26 11:49:47 +01:00
|
|
|
gtester = executable('gtester', 'gtester.c',
|
2016-12-20 23:37:24 +01:00
|
|
|
install : true,
|
2022-09-09 19:56:35 +02:00
|
|
|
install_tag : 'bin-devel',
|
2019-03-05 11:55:19 +01:00
|
|
|
c_args : ['-UG_DISABLE_ASSERT'],
|
2016-12-20 23:37:24 +01:00
|
|
|
include_directories : configinc,
|
|
|
|
dependencies : [libglib_dep])
|
|
|
|
endif
|
2016-03-07 12:13:24 +01:00
|
|
|
|
2018-09-25 00:02:02 +02:00
|
|
|
report_conf = configuration_data()
|
|
|
|
report_conf.set('GLIB_VERSION', glib_version)
|
|
|
|
report_conf.set('PYTHON', python_name)
|
|
|
|
configure_file(
|
|
|
|
input: 'gtester-report.in',
|
|
|
|
output: 'gtester-report',
|
|
|
|
install_dir: get_option('bindir'),
|
2022-09-09 19:56:35 +02:00
|
|
|
install_tag : 'bin-devel',
|
2018-09-25 00:02:02 +02:00
|
|
|
configuration: report_conf,
|
|
|
|
install_mode: 'rwxr-xr-x'
|
|
|
|
)
|
2017-07-27 10:48:11 +02:00
|
|
|
|
2022-09-18 22:51:55 +02:00
|
|
|
install_data('glib_gdb.py',
|
|
|
|
install_dir : glib_pkgdatadir / 'gdb',
|
|
|
|
install_tag : 'devel',
|
|
|
|
)
|
2016-12-06 14:07:03 +01:00
|
|
|
|
2022-02-25 22:50:18 +01:00
|
|
|
# This is needed to make gdb find glib_gdb.py
|
2022-05-05 20:24:30 +02:00
|
|
|
env = environment()
|
|
|
|
env.prepend('PYTHONPATH', meson.current_source_dir())
|
|
|
|
meson.add_devenv(env)
|
2022-02-25 22:50:18 +01:00
|
|
|
|
2016-12-06 14:07:03 +01:00
|
|
|
gdb_conf = configuration_data()
|
|
|
|
gdb_conf.set('datadir', glib_datadir)
|
2017-11-02 05:52:39 +01:00
|
|
|
# This is also used in gobject/meson.build
|
|
|
|
if host_system != 'windows'
|
2021-10-07 18:03:28 +02:00
|
|
|
gdb_install = true
|
2017-11-02 05:52:39 +01:00
|
|
|
else
|
2017-11-02 05:33:22 +01:00
|
|
|
# FIXME: Cannot install on Windows because the path will contain a drive
|
|
|
|
# letter and colons are not allowed in paths.
|
2021-10-07 18:03:28 +02:00
|
|
|
gdb_install = false
|
2017-11-02 05:52:39 +01:00
|
|
|
endif
|
2021-10-07 18:03:28 +02:00
|
|
|
|
|
|
|
# XXX: We add a leading './' because glib_libdir is an absolute path and we
|
|
|
|
# need it to be a relative path so that join_paths appends it to the end.
|
|
|
|
gdb_install_dir = join_paths(glib_datadir, 'gdb', 'auto-load', './' + glib_libdir)
|
|
|
|
|
2017-11-02 05:52:39 +01:00
|
|
|
configure_file(
|
|
|
|
input: 'libglib-gdb.py.in',
|
|
|
|
output: 'libglib-2.0.so.@0@-gdb.py'.format(library_version),
|
|
|
|
configuration: gdb_conf,
|
|
|
|
install_dir: gdb_install_dir,
|
2022-09-18 22:51:55 +02:00
|
|
|
install_tag: 'devel',
|
2021-10-07 18:03:28 +02:00
|
|
|
install: gdb_install,
|
2016-12-06 14:07:03 +01:00
|
|
|
)
|
|
|
|
|
2017-01-25 18:02:51 +01:00
|
|
|
if enable_systemtap
|
|
|
|
glib_stp = configure_file(input : 'glib.stp.in',
|
|
|
|
output : '@0@.stp'.format(libglib.full_path().split('/').get(-1)),
|
|
|
|
configuration : stp_cdata,
|
|
|
|
install_dir : tapset_install_dir,
|
2022-09-20 17:29:27 +02:00
|
|
|
install_tag : 'systemtap',
|
2019-06-17 17:52:36 +02:00
|
|
|
)
|
2017-01-25 18:02:51 +01:00
|
|
|
endif
|
|
|
|
|
2019-04-16 12:19:41 +02:00
|
|
|
if build_tests
|
|
|
|
subdir('tests')
|
2019-06-17 17:52:36 +02:00
|
|
|
endif
|