diff options
author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2018-04-26 00:00:00 +0000 |
---|---|---|
committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2018-04-26 13:00:19 +0200 |
commit | eb4e0fc8f9e278e81a3191f5e30610aaf4aaa762 (patch) | |
tree | a46142828e4a1b892f5b013d65ffa8727c80ee00 /giscanner/meson.build | |
parent | cf758608312525fb1826027757412f2b62e77f7f (diff) | |
download | gobject-introspection-eb4e0fc8f9e278e81a3191f5e30610aaf4aaa762.tar.gz |
Add --version option to Python based tools.
Version file is generated at build time and stored as _version.py.
To support running uninstalled tools, a fallback version is included as
well. Example output of `--version` option:
```
$ for t in g-ir-{annotation-tool,scanner,doc-tool}; do $t --version; done
g-ir-annotation-tool 1.57.1
g-ir-scanner 1.57.1
g-ir-doc-tool 1.57.1
```
Diffstat (limited to 'giscanner/meson.build')
-rw-r--r-- | giscanner/meson.build | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/giscanner/meson.build b/giscanner/meson.build index 006722d2..5a1e44c9 100644 --- a/giscanner/meson.build +++ b/giscanner/meson.build @@ -31,12 +31,18 @@ pkglibdir = join_paths(get_option('libdir'), meson.project_name()) giscannerdir = join_paths(pkglibdir, 'giscanner') giscanner_built_files = [] -blank_conf = configuration_data() +giscanner_conf_data = configuration_data() +giscanner_conf_data.set('VERSION', meson.project_version()) +giscanner_built_files += configure_file(input: '_version.py.in', + output: '_version.py', + install : true, + install_dir : giscannerdir, + configuration: giscanner_conf_data) foreach f : giscanner_files giscanner_built_files += configure_file(input : f, output : f, install : true, install_dir : giscannerdir, - configuration : blank_conf) + configuration : giscanner_conf_data) endforeach install_subdir('doctemplates', install_dir: giscannerdir) |