diff options
-rw-r--r-- | doc/meson.build | 20 | ||||
-rw-r--r-- | libgupnp-igd/meson.build | 58 | ||||
-rw-r--r-- | meson.build | 18 | ||||
-rw-r--r-- | meson_options.txt | 2 | ||||
-rw-r--r-- | tests/examples/meson.build | 11 | ||||
-rw-r--r-- | tests/gtest/meson.build | 12 | ||||
-rw-r--r-- | tests/meson.build | 2 |
7 files changed, 123 insertions, 0 deletions
diff --git a/doc/meson.build b/doc/meson.build new file mode 100644 index 0000000..1926961 --- /dev/null +++ b/doc/meson.build @@ -0,0 +1,20 @@ +entities = configuration_data() +entities.set('VERSION', meson.project_version()) +version_xml = configure_file(input: 'version.xml.in', + output: 'version.xml', configuration: + entities) + +gnome.gtkdoc( + 'gupnp-igd', + main_xml : 'gupnp-igd-docs.xml', + src_dir : [ + join_paths(meson.source_root(), 'libgupnp-igd'), + join_paths(meson.build_root(), 'libgupnp-igd') + ], + dependencies : libgupnp_igd, + scan_args : [ + '--ignore-decorators', 'G_DEPRECATED|G_GNUC_DEPRECATED,G_DEPRECATED_FOR' + ], + install : true +) + diff --git a/libgupnp-igd/meson.build b/libgupnp-igd/meson.build new file mode 100644 index 0000000..a4f267f --- /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, + namespace : 'GUPnPIgd', + nsversion : '1.0', + symbol_prefix: ['gupnp'], + 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..8dbd0ac --- /dev/null +++ b/meson.build @@ -0,0 +1,18 @@ +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') +if get_option('gtk_doc') + subdir('doc') +endif diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..2b0a73b --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,2 @@ +option('introspection', type: 'boolean', value : true, description: 'Enable or disable GObject Introspection') +option('gtk_doc', type: 'boolean', value: 'false', description: 'Build GTK-Doc API documentation') 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') |