[gnome-builder] meson: fix path to meson.build when setting :project-file
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] meson: fix path to meson.build when setting :project-file
- Date: Mon, 14 Jan 2019 21:22:31 +0000 (UTC)
commit 1a28d404164593e57153080bf8c957647eb4d342
Author: Christian Hergert <chergert redhat com>
Date: Mon Jan 14 13:22:14 2019 -0800
meson: fix path to meson.build when setting :project-file
Fixes #755
src/plugins/meson/gbp-meson-build-system.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/meson/gbp-meson-build-system.c b/src/plugins/meson/gbp-meson-build-system.c
index 7961bbf6a..8e74998a1 100644
--- a/src/plugins/meson/gbp-meson-build-system.c
+++ b/src/plugins/meson/gbp-meson-build-system.c
@@ -346,6 +346,24 @@ gbp_meson_build_system_load_commands_finish (GbpMesonBuildSystem *self,
return ide_task_propagate_pointer (IDE_TASK (result), error);
}
+static void
+gbp_meson_build_system_set_project_file (GbpMesonBuildSystem *self,
+ GFile *file)
+{
+ g_autofree gchar *name = NULL;
+
+ g_assert (IDE_IS_MAIN_THREAD ());
+ g_assert (GBP_IS_MESON_BUILD_SYSTEM (self));
+ g_assert (G_IS_FILE (file));
+
+ name = g_file_get_basename (file);
+
+ if (ide_str_equal0 (name, "meson.build"))
+ self->project_file = g_file_dup (file);
+ else
+ self->project_file = g_file_get_child (file, "meson.build");
+}
+
static void
gbp_meson_build_system_finalize (GObject *object)
{
@@ -389,7 +407,7 @@ gbp_meson_build_system_set_property (GObject *object,
switch (prop_id)
{
case PROP_PROJECT_FILE:
- self->project_file = g_value_dup_object (value);
+ gbp_meson_build_system_set_project_file (self, g_value_get_object (value));
break;
default:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]