From f32b90ec2f6d9fcd7907d60324f08bfa47a362df Mon Sep 17 00:00:00 2001 From: Bruce Cowan <bruce@bcowan.me.uk> Date: Tue, 21 Sep 2021 19:29:24 +0100 Subject: [PATCH] Better configuration file handling --- meson.build | 16 +++++++--------- src/main.c | 2 +- src/meson.build | 3 ++- src/rugby-app-window.c | 2 +- src/rugby-possibility-widget.c | 2 +- src/rugby-possibility.c | 2 +- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/meson.build b/meson.build index 99574da..1ae5ad2 100644 --- a/meson.build +++ b/meson.build @@ -16,16 +16,14 @@ gtk_dep = dependency('gtk4', version: '>= 4.0') conf = configuration_data() conf.set_quoted('VERSION','@VCS_TAG@') - -config_h = declare_dependency( - sources: vcs_tag( - input: configure_file( - output: 'config.h.in', - configuration: conf - ), - output: 'config.h', - ) +vcs_tag( + input: configure_file( + output: 'config.h.in', + configuration: conf + ), + output: 'config.h', ) +configuration_inc = include_directories('.') cflags = [] cflags += ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46', diff --git a/src/main.c b/src/main.c index 4642cb0..d94fc32 100644 --- a/src/main.c +++ b/src/main.c @@ -3,7 +3,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -#include "config.h" +#include <config.h> #include "rugby-app-window.h" #include "rugby-pref-window.h" diff --git a/src/meson.build b/src/meson.build index 903b613..3bb7448 100644 --- a/src/meson.build +++ b/src/meson.build @@ -12,6 +12,7 @@ sources = [ executable('rugby', sources, resources, compiled_schemas, - dependencies: [config_h, gio_dep, gtk_dep], + dependencies: [gio_dep, gtk_dep], + include_directories: configuration_inc, install_dir: get_option('bindir'), install: true) diff --git a/src/rugby-app-window.c b/src/rugby-app-window.c index 7c972fc..ca1b448 100644 --- a/src/rugby-app-window.c +++ b/src/rugby-app-window.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -#include "config.h" +#include <config.h> #include "rugby-app-window.h" #include "rugby-list-store.h" diff --git a/src/rugby-possibility-widget.c b/src/rugby-possibility-widget.c index 94a1c94..4483c9f 100644 --- a/src/rugby-possibility-widget.c +++ b/src/rugby-possibility-widget.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -#include "config.h" +#include <config.h> #include "rugby-possibility-widget.h" diff --git a/src/rugby-possibility.c b/src/rugby-possibility.c index 768a78c..7bedabe 100644 --- a/src/rugby-possibility.c +++ b/src/rugby-possibility.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -#include "config.h" +#include <config.h> #include "rugby-possibility.h" struct _RugbyPossibility -- GitLab