[gupnp-igd/wip/meson] build: Initial meson files



commit cc8fbef509c5216de31dd3c77d36b0ec5d12cc7a
Author: Jens Georg <mail jensge org>
Date:   Tue Oct 29 16:55:11 2019 +0100

    build: Initial meson files

 libgupnp-igd/meson.build   | 58 ++++++++++++++++++++++++++++++++++++++++++++++
 meson.build                | 15 ++++++++++++
 meson_options.txt          |  1 +
 tests/examples/meson.build | 11 +++++++++
 tests/gtest/meson.build    | 12 ++++++++++
 tests/meson.build          |  2 ++
 6 files changed, 99 insertions(+)
---
diff --git a/libgupnp-igd/meson.build b/libgupnp-igd/meson.build
new file mode 100644
index 0000000..a1bcb76
--- /dev/null
+++ b/libgupnp-igd/meson.build
@@ -0,0 +1,58 @@
+marshal = gnome.genmarshal(
+    'gupnp-simple-igd-marshal',
+    sources : 'gupnp-simple-igd-marshal.list',
+    prefix : '_gupnp_simple_igd_marshal'
+)
+
+headers = files(
+    'gupnp-simple-igd.h',
+    'gupnp-simple-igd-thread.h'
+)
+
+install_headers(headers, subdir: 'gupnp-igd-1.0/libgupnp-igd')
+
+sources = files(
+    'gupnp-enum-types.c',
+    'gupnp-enum-types.h',
+    'gupnp-simple-igd.c',
+    'gupnp-simple-igd-priv.h',
+    'gupnp-simple-igd-thread.c'
+)
+
+libgupnp_igd = library(
+    'gupnp-igd-1.0',
+    sources + marshal,
+    version: '4.2.0',
+    include_directories: include_directories('..'),
+    dependencies : dependencies,
+    install: true)
+
+gupnp_igd = declare_dependency(
+    link_with : libgupnp_igd,
+    include_directories : include_directories('..'),
+    dependencies: dependencies
+)
+
+pkg.generate(
+    libraries : libgupnp_igd,
+    name : 'gupnp-igd-1.0',
+    subdirs : 'gupnp-igd-1.0',
+    filebase : 'gupnp-igd-1.0',
+    description: 'GUPnP Simple IGD library',
+    requires : 'gupnp-1.0'
+)
+
+
+if get_option('introspection')
+    gnome.generate_gir(
+        libgupnp_igd,
+        sources : headers + sources + marshal,
+        namespace : 'GUPnPIgd',
+        nsversion : '1.0',
+        symbol_prefix: ['gupnp', 'gupnp_igd'],
+        identifier_prefix : 'GUPnP',
+        install: true,
+        export_packages : 'gupnp-1.0',
+        includes : ['GObject-2.0']
+    )
+endif
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..17f99e9
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,15 @@
+project('gupnp-igd', 'c', version: '0.2.5')
+
+gnome = import('gnome')
+pkg = import('pkgconfig')
+
+dependencies = [
+    dependency('glib-2.0', version: '>= 2.26', required: true),
+    dependency('gobject-2.0', version: '>= 2.26', required: true),
+    dependency('gssdp-1.0', required: true),
+    dependency('gupnp-1.0', version: '>= 0.18', required: true),
+    dependency('gthread-2.0', required: true)
+]
+
+subdir('libgupnp-igd')
+subdir('tests')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..1a21516
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1 @@
+option('introspection', type: 'boolean', value : true, description: 'Enable or disable GObject 
Introspection')
diff --git a/tests/examples/meson.build b/tests/examples/meson.build
new file mode 100644
index 0000000..8e1bed7
--- /dev/null
+++ b/tests/examples/meson.build
@@ -0,0 +1,11 @@
+executable(
+    'test-igd',
+    files('test.c'),
+    dependencies : gupnp_igd
+)
+
+executable(
+    'test-thread',
+    files('test-thread.c'),
+    dependencies : gupnp_igd
+)
diff --git a/tests/gtest/meson.build b/tests/gtest/meson.build
new file mode 100644
index 0000000..fa30c3a
--- /dev/null
+++ b/tests/gtest/meson.build
@@ -0,0 +1,12 @@
+simple_test = executable(
+    'gupnp-simple-igd',
+    files('gupnp-simple-igd.c'),
+    dependencies : gupnp_igd,
+)
+
+test(
+    'gupnp-simple-igd',
+    simple_test,
+    is_parallel: false,
+    env: 'XML_PATH=@0@'.format(meson.current_source_dir())
+)
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000..7ea8501
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,2 @@
+subdir('gtest')
+subdir('examples')


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