[gnome-builder] meson: implement IdeBuildSystem.supports_language()
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] meson: implement IdeBuildSystem.supports_language()
- Date: Mon, 2 Aug 2021 21:10:54 +0000 (UTC)
commit c45cc8474211f7d1367d19c8b39dafe8b0b74275
Author: Christian Hergert <chergert redhat com>
Date: Mon Aug 2 14:09:26 2021 -0700
meson: implement IdeBuildSystem.supports_language()
This uses the previous work to track the supported languages and instead
uses a lookup semantics rather than the "get everything" semmantics.
src/plugins/meson/gbp-meson-build-system.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/meson/gbp-meson-build-system.c b/src/plugins/meson/gbp-meson-build-system.c
index e75d6ca39..ea90c35e0 100644
--- a/src/plugins/meson/gbp-meson-build-system.c
+++ b/src/plugins/meson/gbp-meson-build-system.c
@@ -719,12 +719,27 @@ gbp_meson_build_system_get_project_version (IdeBuildSystem *build_system)
{
GbpMesonBuildSystem *self = (GbpMesonBuildSystem *)build_system;
- g_return_val_if_fail (IDE_IS_MAIN_THREAD (), NULL);
- g_return_val_if_fail (GBP_IS_MESON_BUILD_SYSTEM (self), NULL);
+ g_assert (IDE_IS_MAIN_THREAD ());
+ g_assert (GBP_IS_MESON_BUILD_SYSTEM (self));
return g_strdup (self->project_version);
}
+static gboolean
+gbp_meson_build_system_supports_language (IdeBuildSystem *system,
+ const char *language)
+{
+ GbpMesonBuildSystem *self = (GbpMesonBuildSystem *)system;
+
+ g_assert (GBP_IS_MESON_BUILD_SYSTEM (self));
+ g_assert (language != NULL);
+
+ if (self->languages != NULL)
+ return g_strv_contains ((const char * const *)self->languages, language);
+
+ return FALSE;
+}
+
static void
build_system_iface_init (IdeBuildSystemInterface *iface)
{
@@ -738,6 +753,7 @@ build_system_iface_init (IdeBuildSystemInterface *iface)
iface->get_builddir = gbp_meson_build_system_get_builddir;
iface->get_project_version = gbp_meson_build_system_get_project_version;
iface->supports_toolchain = gbp_meson_build_system_supports_toolchain;
+ iface->supports_language = gbp_meson_build_system_supports_language;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]