diff options
author | Niels De Graef <nielsdegraef@gmail.com> | 2019-05-08 08:27:38 +0200 |
---|---|---|
committer | Günther Wagner <info@gunibert.de> | 2021-10-21 12:52:27 +0200 |
commit | afcf2ed34ca0b47aaee6f81625d4deec2c3d6bb9 (patch) | |
tree | 43bad38eb62e220408b4cc053c54ced78db8ae28 /rest | |
parent | 409dec8b596bb6cc3b8e25d0572bf5cd38130968 (diff) | |
download | librest-afcf2ed34ca0b47aaee6f81625d4deec2c3d6bb9.tar.gz |
Port to the Meson build system
See the [Meson website] for a full reference. To build, test and/or
install the librest library, you essentially need the following commands:
```
$ meson build
$ ninja -C build
$ meson test -C build
$ ninja -C build install
```
For the GNOME initiative, see
https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
[Meson website]: http://mesonbuild.com/
https://gitlab.gnome.org/GNOME/librest/merge_requests/1
Diffstat (limited to 'rest')
-rw-r--r-- | rest/meson.build | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/rest/meson.build b/rest/meson.build new file mode 100644 index 0000000..7bf7338 --- /dev/null +++ b/rest/meson.build @@ -0,0 +1,107 @@ +librest_enums = gnome.mkenums_simple('rest-enum-types', + sources: [ 'rest-proxy.h', 'rest-proxy-call.h' ], + install_header: true, + install_dir: get_option('includedir') / librest_pkg_string / 'rest', +) + +librest_marshal = gnome.genmarshal('rest-marshal', + sources: 'rest-marshal.txt', +) + +librest_sources = [ + 'rest-param.c', + 'rest-params.c', + 'rest-proxy.c', + 'rest-proxy-auth.c', + 'rest-proxy-call.c', + 'rest-xml-node.c', + 'rest-xml-parser.c', + 'rest-main.c', + 'oauth-proxy.c', + 'oauth-proxy-call.c', + 'oauth2-proxy.c', + 'oauth2-proxy-call.c', + 'sha1.c', + + librest_enums, + librest_marshal, +] + +librest_headers = [ + 'oauth-proxy-call.h', + 'oauth-proxy.h', + 'oauth2-proxy-call.h', + 'oauth2-proxy.h', + 'rest-param.h', + 'rest-params.h', + 'rest-proxy-auth.h', + 'rest-proxy-call.h', + 'rest-proxy.h', + 'rest-xml-node.h', + 'rest-xml-parser.h', +] + +librest_deps = [ + glib_dep, + libsoup_dep, + libxml_dep, +] + +librest_c_args = [ + '-DG_LOG_DOMAIN="Rest"', +] + +librest_lib = library('rest-@0@'.format(librest_api_version), + librest_sources, + dependencies: librest_deps, + c_args: librest_c_args, + include_directories: config_h_inc, + version: librest_module_version, + soversion: librest_soversion, + install: true, +) + +install_headers(librest_headers, + subdir: librest_pkg_string / 'rest', +) + +# GObject Introspection +if get_option('introspection') + librest_gir_extra_args = [ + '--accept-unprefixed', + '--c-include=rest/rest-enum-types.h', + ] + + foreach header : librest_headers + librest_gir_extra_args += '--c-include=rest/@0@'.format(header) + endforeach + + librest_gir = gnome.generate_gir(librest_lib, + sources: [ librest_headers, librest_enums[1] ], + namespace: 'Rest', + nsversion: librest_api_version, + includes: [ 'GObject-2.0', 'Gio-2.0', 'Soup-2.4' ], + extra_args: librest_gir_extra_args, + install: true, + ) +endif + +librest_dep = declare_dependency( + link_with: librest_lib, +) + +# Test suite +test_runner_c_args = [ + '-DBUILD_TESTS', +] + +test_runner_bin = executable('test-runner', + [ 'test-runner.c', librest_sources ], + dependencies: librest_deps, + c_args: test_runner_c_args, + include_directories: config_h_inc, +) + +test('test-runner', test_runner_bin, + suite: 'rest', +) |