Merge branch 'ebassi/glib-min-version' into 'master'

Ebassi/glib min version

See merge request GNOME/gtk!2880
This commit is contained in:
Emmanuele Bassi 2020-11-23 14:33:20 +00:00
commit fd3a6299ce
3 changed files with 8 additions and 23 deletions

View File

@ -976,14 +976,11 @@ gtk_sources += [
gtk_deps = [
gmodule_dep,
glib_dep,
gobject_dep,
platform_gio_dep,
pangocairo_dep,
pango_dep,
fribidi_dep,
cairogobj_dep,
cairo_dep,
fontconfig_dep,
pixbuf_dep,
epoxy_dep,

View File

@ -52,16 +52,17 @@ usage (void)
exit (1);
}
#if !GLIB_CHECK_VERSION(2,67,0)
/* A simplified version of g_log_writer_default_would_drop(), to avoid
* bumping up the required version of GLib to 2.68
*/
static gboolean
g_log_writer_default_would_drop (GLogLevelFlags level,
const char *domain)
would_drop (GLogLevelFlags level,
const char *domain)
{
return (level & (G_LOG_LEVEL_ERROR |
G_LOG_LEVEL_CRITICAL |
G_LOG_LEVEL_WARNING)) == 0;
}
#endif
static GLogWriterOutput
log_writer_func (GLogLevelFlags level,
@ -81,7 +82,7 @@ log_writer_func (GLogLevelFlags level,
message = fields[i].value;
}
if (message != NULL && !g_log_writer_default_would_drop (level, domain))
if (message != NULL && !would_drop (level, domain))
{
const char *prefix;
switch (level & G_LOG_LEVEL_MASK)

View File

@ -10,19 +10,7 @@ project('gtk', 'c',
meson_version : '>= 0.54',
license: 'LGPLv2.1+')
glib_major_req = 2
glib_minor_req = 65
glib_micro_req = 0
if glib_minor_req.is_odd()
glib_min_required = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req - 1)
glib_max_allowed = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req + 1)
else
glib_min_required = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req)
glib_max_allowed = 'GLIB_VERSION_@0@_@1@'.format(glib_major_req, glib_minor_req)
endif
glib_req = '>= @0@.@1@.@2@'.format(glib_major_req, glib_minor_req, glib_micro_req)
glib_req = '>= 2.66.0'
pango_req = '>= 1.47.0' # keep this in sync with .gitlab-ci/test-msys.sh
fribidi_req = '>= 0.19.7'
cairo_req = '>= 1.14.0'
@ -39,8 +27,7 @@ sysprof_req = '>= 3.38.0'
gnome = import('gnome')
add_project_arguments('-DG_LOG_USE_STRUCTURED=1', language: 'c')
add_project_arguments('-DGLIB_MIN_REQUIRED_VERSION=' + glib_min_required, language: 'c')
add_project_arguments('-DGLIB_MAX_ALLOWED_VERSION=' + glib_max_allowed, language: 'c')
add_project_arguments('-DGLIB_DISABLE_DEPRECATION_WARNINGS', language: 'c')
# Making releases:
# 1. gtk_micro_version += 1;