[libgit2-glib/wip/inigomartinez/meson: 11/13] meson: Use a variable for the namespace string
- From: Iñigo Martínez <inigomartinez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib/wip/inigomartinez/meson: 11/13] meson: Use a variable for the namespace string
- Date: Fri, 19 Jan 2018 21:11:30 +0000 (UTC)
commit 4a4bf65692d359215da0481fa6bb3d42bc2ee04b
Author: Iñigo Martínez <inigomartinez gmail com>
Date: Fri Jan 19 16:50:03 2018 +0100
meson: Use a variable for the namespace string
The namespace string is used in multiple places in the meson's build
files.
This patch uses a variable which eases the use of this string
through the build files.
https://bugzilla.gnome.org/show_bug.cgi?id=792699
libgit2-glib/meson.build | 8 ++++----
meson.build | 2 ++
2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/libgit2-glib/meson.build b/libgit2-glib/meson.build
index 55918f6..91ffa78 100644
--- a/libgit2-glib/meson.build
+++ b/libgit2-glib/meson.build
@@ -207,7 +207,7 @@ libgit2_glib = shared_library('git2-glib-@0@'.format(libgit2_glib_api_version),
soversion: soversion,
install: true,
dependencies: platform_deps,
- c_args: extra_args + [ '-DG_LOG_DOMAIN="Ggit"' ],
+ c_args: extra_args + [ '-DG_LOG_DOMAIN="@0@"'.format(libgit2_glib_ns) ],
link_args: libgit2_glib_link_args)
pkg.generate(
@@ -232,10 +232,10 @@ libgit2_glib_dep = declare_dependency(link_with: libgit2_glib,
if enable_gir
gnome.generate_gir(libgit2_glib,
sources: headers + sources,
- namespace: 'Ggit',
+ namespace: libgit2_glib_ns,
nsversion: libgit2_glib_api_version,
- identifier_prefix: 'Ggit',
- symbol_prefix: 'ggit',
+ identifier_prefix: libgit2_glib_ns,
+ symbol_prefix: libgit2_glib_ns.to_lower(),
includes: [ 'GObject-2.0', 'GLib-2.0', 'Gio-2.0' ],
header: ggit_h,
install: true)
diff --git a/meson.build b/meson.build
index c7a28cd..043fb0b 100644
--- a/meson.build
+++ b/meson.build
@@ -15,6 +15,8 @@ libgit2_glib_micro_version = version_array[2].to_int()
libgit2_glib_api_version = '1.0'
libgit2_glib_api_name = '@0@-@1@'.format(meson.project_name(), libgit2_glib_api_version)
+libgit2_glib_ns = 'Ggit'
+
libgit2_glib_buildtype = get_option('buildtype')
# The interface age is reset every time we add new API; this
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]