[gnome-builder] meson: check for meson in test provider
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] meson: check for meson in test provider
- Date: Mon, 18 Dec 2017 08:23:48 +0000 (UTC)
commit aa6c602a92dd360662dd8a63c5cf2404c7e677a1
Author: Christian Hergert <chergert redhat com>
Date: Mon Dec 18 00:23:17 2017 -0800
meson: check for meson in test provider
If we don't have a meson project, the test provider shouldn't
try to do anything.
src/plugins/meson/gbp-meson-test-provider.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/meson/gbp-meson-test-provider.c b/src/plugins/meson/gbp-meson-test-provider.c
index 5a33a45..e9b7dd1 100644
--- a/src/plugins/meson/gbp-meson-test-provider.c
+++ b/src/plugins/meson/gbp-meson-test-provider.c
@@ -20,6 +20,7 @@
#include <json-glib/json-glib.h>
+#include "gbp-meson-build-system.h"
#include "gbp-meson-test.h"
#include "gbp-meson-test-provider.h"
@@ -261,6 +262,7 @@ gbp_meson_test_provider_reload (gpointer user_data)
GbpMesonTestProvider *self = user_data;
IdeBuildPipeline *pipeline;
IdeBuildManager *build_manager;
+ IdeBuildSystem *build_system;
IdeContext *context;
IDE_ENTRY;
@@ -274,10 +276,17 @@ gbp_meson_test_provider_reload (gpointer user_data)
g_clear_object (&self->build_cancellable);
/*
+ * Check that we're working with a meson build system.
+ */
+ context = ide_object_get_context (IDE_OBJECT (self));
+ build_system = ide_context_get_build_system (context);
+ if (build_system == NULL)
+ IDE_RETURN (G_SOURCE_REMOVE);
+
+ /*
* Get access to the pipeline so we can create a launcher to
* introspect meson from within the build environment.
*/
- context = ide_object_get_context (IDE_OBJECT (self));
build_manager = ide_context_get_build_manager (context);
pipeline = ide_build_manager_get_pipeline (build_manager);
if (pipeline == NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]