Commit f5532e6b authored by Christian Hergert's avatar Christian Hergert

build: specify min/max glib versions in meson.build

This ensures that we don't use API that we cannot use, but also ensures
that we don't need to litter the source code with begin/end ignore
deprecations.
parent d977962a
Pipeline #125907 passed with stages
in 9 minutes and 51 seconds
......@@ -1299,7 +1299,6 @@ peas_engine_provides_extension (PeasEngine *engine,
return peas_plugin_loader_provides_extension (loader, info, extension_type);
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/**
* peas_engine_create_extensionv: (skip)
* @engine: A #PeasEngine.
......@@ -1351,7 +1350,6 @@ peas_engine_create_extensionv (PeasEngine *engine,
return extension;
}
G_GNUC_END_IGNORE_DEPRECATIONS
/**
* peas_engine_create_extension_with_properties: (rename-to peas_engine_create_extension)
......@@ -1384,8 +1382,6 @@ peas_engine_create_extension_with_properties (PeasEngine *engine,
const gchar **prop_names,
const GValue *prop_values)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
PeasPluginLoader *loader;
PeasExtension *extension;
GParameter *parameters = NULL;
......@@ -1430,8 +1426,6 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
}
return extension;
G_GNUC_END_IGNORE_DEPRECATIONS
}
/**
......@@ -1462,9 +1456,7 @@ peas_engine_create_extension_valist (PeasEngine *engine,
const gchar *first_property,
va_list var_args)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
GParameter *parameters;
G_GNUC_END_IGNORE_DEPRECATIONS
PeasExtension *exten;
guint n_parameters;
......
......@@ -91,9 +91,7 @@ struct _PeasExtensionSetPrivate {
GType exten_type;
guint n_parameters;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
GParameter *parameters;
G_GNUC_END_IGNORE_DEPRECATIONS
GQueue extensions;
};
......@@ -106,9 +104,7 @@ typedef struct {
typedef struct {
guint n_parameters;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
GParameter *parameters;
G_GNUC_END_IGNORE_DEPRECATIONS
} PeasParameterArray;
/* Signals */
......@@ -146,9 +142,7 @@ set_construct_properties (PeasExtensionSet *set,
priv->n_parameters = array->n_parameters;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
priv->parameters = g_new0 (GParameter, array->n_parameters);
G_GNUC_END_IGNORE_DEPRECATIONS
for (i = 0; i < array->n_parameters; i++)
{
......@@ -611,8 +605,6 @@ peas_extension_set_foreach (PeasExtensionSet *set,
}
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/**
* peas_extension_set_newv: (skip)
* @engine: (allow-none): A #PeasEngine, or %NULL.
......@@ -766,8 +758,6 @@ peas_extension_set_new_valist (PeasEngine *engine,
return set;
}
G_GNUC_END_IGNORE_DEPRECATIONS
/**
* peas_extension_set_new: (skip)
* @engine: (allow-none): A #PeasEngine, or %NULL.
......
......@@ -431,7 +431,6 @@ peas_object_module_new_embedded (const gchar *module_name,
NULL));
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/**
* peas_object_module_create_object: (skip)
* @module: A #PeasObjectModule.
......@@ -472,7 +471,6 @@ peas_object_module_create_object (PeasObjectModule *module,
return NULL;
}
G_GNUC_END_IGNORE_DEPRECATIONS
/**
* peas_object_module_provides_object: (skip)
......@@ -624,7 +622,6 @@ peas_object_module_register_extension_factory (PeasObjectModule *module,
g_debug ("Registered extension for type '%s'", g_type_name (exten_type));
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static GObject *
create_gobject_from_type (guint n_parameters,
GParameter *parameters,
......@@ -654,7 +651,6 @@ create_gobject_from_type (guint n_parameters,
return G_OBJECT (g_object_newv (impl_type, n_parameters, parameters));
}
G_GNUC_END_IGNORE_DEPRECATIONS
/**
* peas_object_module_register_extension_type:
......
......@@ -110,7 +110,6 @@ peas_plugin_loader_c_provides_extension (PeasPluginLoader *loader,
return peas_object_module_provides_object (info->loader_data, exten_type);
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static PeasExtension *
peas_plugin_loader_c_create_extension (PeasPluginLoader *loader,
PeasPluginInfo *info,
......@@ -159,7 +158,6 @@ peas_plugin_loader_c_create_extension (PeasPluginLoader *loader,
return instance;
}
G_GNUC_END_IGNORE_DEPRECATIONS
static void
peas_plugin_loader_c_init (PeasPluginLoaderC *cloader)
......
......@@ -114,7 +114,6 @@ peas_plugin_loader_provides_extension (PeasPluginLoader *loader,
return klass->provides_extension (loader, info, ext_type);
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
PeasExtension *
peas_plugin_loader_create_extension (PeasPluginLoader *loader,
PeasPluginInfo *info,
......@@ -130,7 +129,6 @@ peas_plugin_loader_create_extension (PeasPluginLoader *loader,
return klass->create_extension (loader, info, ext_type,
n_parameters, parameters);
}
G_GNUC_END_IGNORE_DEPRECATIONS
void
peas_plugin_loader_garbage_collect (PeasPluginLoader *loader)
......
......@@ -180,7 +180,6 @@ find_param_spec_for_prerequisites (const gchar *name,
return pspec;
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gboolean
peas_utils_properties_array_to_parameter_list (GType exten_type,
guint n_properties,
......@@ -305,7 +304,6 @@ error:
g_free (*params);
return FALSE;
}
G_GNUC_END_IGNORE_DEPRECATIONS
gint
peas_utils_get_loader_id (const gchar *loader)
......
......@@ -155,7 +155,6 @@ peas_plugin_loader_lua_provides_extension (PeasPluginLoader *loader,
return the_type != G_TYPE_INVALID;
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static PeasExtension *
peas_plugin_loader_lua_create_extension (PeasPluginLoader *loader,
PeasPluginInfo *info,
......@@ -196,7 +195,6 @@ out:
thread_leave (lua_loader, info, &L);
return object;
}
G_GNUC_END_IGNORE_DEPRECATIONS
static gboolean
peas_plugin_loader_lua_load (PeasPluginLoader *loader,
......
......@@ -101,7 +101,6 @@ peas_plugin_loader_python_provides_extension (PeasPluginLoader *loader,
return the_type != G_TYPE_INVALID;
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static PeasExtension *
peas_plugin_loader_python_create_extension (PeasPluginLoader *loader,
PeasPluginInfo *info,
......@@ -153,7 +152,6 @@ out:
PyGILState_Release (state);
return object;
}
G_GNUC_END_IGNORE_DEPRECATIONS
static gboolean
peas_plugin_loader_python_load (PeasPluginLoader *loader,
......
......@@ -83,7 +83,9 @@ config_h.set_quoted('GETTEXT_PACKAGE', package_string)
# Dependencies
cc = meson.get_compiler('c')
glib_req = '>= 2.38.0'
glib_req_version = '2.38.0'
glib_req = '>= @0@'.format(glib_req_version)
introspection_req = '>= 1.39.0'
gtk_req = '>= 3.0.0'
gtk_doc_req = '>= 1.11'
......@@ -119,6 +121,15 @@ luajit_dep = dependency('luajit', version: luajit_req, required: false)
luajit_prg = find_program('luajit', required: false)
xmllint_prg = find_program('xmllint', required: false)
glib_version_arr = glib_req_version.split('.')
glib_major_version = glib_version_arr[0]
glib_minor_version = glib_version_arr[1]
add_project_arguments([
'-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_@0@_@1@'.format(glib_major_version, glib_minor_version),
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_@0@_@1@'.format(glib_major_version, glib_minor_version),
], language: 'c')
if build_machine.system() == 'darwin'
config_h.set_quoted('OS_OSX', 1)
endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment