[gvdb/wip/pwithnall/meson] build: Add very basic meson build system




commit 061e9b92539cfb5c5c57cca04aa41a9cbf7434ba
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue Jun 7 18:00:41 2022 +0100

    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>

 gvdb-builder.c => gvdb/gvdb-builder.c |  0
 gvdb-builder.h => gvdb/gvdb-builder.h |  0
 gvdb-format.h => gvdb/gvdb-format.h   |  0
 gvdb-reader.c => gvdb/gvdb-reader.c   |  0
 gvdb-reader.h => gvdb/gvdb-reader.h   |  0
 meson.build                           | 15 +++++++++++++++
 6 files changed, 15 insertions(+)
---
diff --git a/gvdb-builder.c b/gvdb/gvdb-builder.c
similarity index 100%
rename from gvdb-builder.c
rename to gvdb/gvdb-builder.c
diff --git a/gvdb-builder.h b/gvdb/gvdb-builder.h
similarity index 100%
rename from gvdb-builder.h
rename to gvdb/gvdb-builder.h
diff --git a/gvdb-format.h b/gvdb/gvdb-format.h
similarity index 100%
rename from gvdb-format.h
rename to gvdb/gvdb-format.h
diff --git a/gvdb-reader.c b/gvdb/gvdb-reader.c
similarity index 100%
rename from gvdb-reader.c
rename to gvdb/gvdb-reader.c
diff --git a/gvdb-reader.h b/gvdb/gvdb-reader.h
similarity index 100%
rename from gvdb-reader.h
rename to 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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]