summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2022-06-07 18:00:41 +0100
committerPhilip Withnall <pwithnall@endlessos.org>2022-06-14 18:39:36 +0100
commit061e9b92539cfb5c5c57cca04aa41a9cbf7434ba (patch)
treeeff0346edf30601ffa7b51a473fcc64be7c33b80
parentdcd781fb7ab565f9d4244d6157bbdd741c8ac6cd (diff)
downloadgvdb-061e9b92539cfb5c5c57cca04aa41a9cbf7434ba.tar.gz
build: Add very basic meson build system
This doesn’t build any files, but does expose the list of sources as a Meson variable so it can be used as a subproject from other projects. I thought about building a static library for gvdb, but this would cause problems for libgio (and gvdb’s use inside libgio is the motivation for making it subproject-able). gvdb depends on libgio types, such as `GCancellable`, but also is a dependency of parts of libgio, such as `GResource`. That circular dependency means that building a static library is non-trivial. There is an approach for achieving this, detailed by Eli Schwartz at https://gitlab.gnome.org/GNOME/gvdb/-/merge_requests/18#note_1474750, but that’s too much work for what I would like to achieve here. It can always be implemented in future, particularly if we add unit tests to gvdb (in this git repository) or if another project starts linking gvdb in using Meson subprojects rather than copy/paste. The files have to be moved to a `gvdb/` subdirectory to keep the include paths working correctly — code in GLib which uses gvdb uses `#include <gvdb/gvdb-builder.h>`. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-rw-r--r--gvdb/gvdb-builder.c (renamed from gvdb-builder.c)0
-rw-r--r--gvdb/gvdb-builder.h (renamed from gvdb-builder.h)0
-rw-r--r--gvdb/gvdb-format.h (renamed from gvdb-format.h)0
-rw-r--r--gvdb/gvdb-reader.c (renamed from gvdb-reader.c)0
-rw-r--r--gvdb/gvdb-reader.h (renamed from gvdb-reader.h)0
-rw-r--r--meson.build15
6 files changed, 15 insertions, 0 deletions
diff --git a/gvdb-builder.c b/gvdb/gvdb-builder.c
index 5dae03e..5dae03e 100644
--- a/gvdb-builder.c
+++ b/gvdb/gvdb-builder.c
diff --git a/gvdb-builder.h b/gvdb/gvdb-builder.h
index 30757d0..30757d0 100644
--- a/gvdb-builder.h
+++ b/gvdb/gvdb-builder.h
diff --git a/gvdb-format.h b/gvdb/gvdb-format.h
index ed6adab..ed6adab 100644
--- a/gvdb-format.h
+++ b/gvdb/gvdb-format.h
diff --git a/gvdb-reader.c b/gvdb/gvdb-reader.c
index 820ce4c..820ce4c 100644
--- a/gvdb-reader.c
+++ b/gvdb/gvdb-reader.c
diff --git a/gvdb-reader.h b/gvdb/gvdb-reader.h
index 79a97d3..79a97d3 100644
--- a/gvdb-reader.h
+++ b/gvdb/gvdb-reader.h
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..01c86b4
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,15 @@
+project('gvdb', 'c',
+ version: '0.0',
+ meson_version: '>=0.54.0',
+)
+
+libgvdb_sources = files(
+ 'gvdb/gvdb-builder.c',
+ 'gvdb/gvdb-reader.c',
+)
+
+gvdb_dep = declare_dependency(
+ sources: libgvdb_sources,
+ include_directories: include_directories('.'),
+)
+meson.override_dependency('gvdb', gvdb_dep)