build: Improve Meson distribution file

Generate .tarball-version file.
Code from spice-gtk.
Meson 0.49 is required for multiple parameters to meson.add_dist_script.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
This commit is contained in:
Frediano Ziglio 2021-06-13 19:20:57 +01:00
parent 6534d72a1e
commit 0219bea62e
2 changed files with 19 additions and 1 deletions

16
build-aux/meson-dist Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
set -e
set -o pipefail
if test "$1" = ""; then
echo "Version not provided" >&2
exit 1
fi
if ! test -d "$2"; then
echo "Source directory not provided" >&2
exit 1
fi
# generate tarball version
echo "$1" > "$MESON_DIST_ROOT/.tarball-version"

View File

@ -4,10 +4,12 @@
project('spice', 'c', 'cpp',
version : run_command('build-aux/git-version-gen', meson.source_root() + '/.tarball-version', check : true).stdout().strip(),
license : 'LGPLv2.1',
meson_version : '>= 0.48',
meson_version : '>= 0.49',
default_options : ['buildtype=debugoptimized',
'warning_level=2'])
meson.add_dist_script('build-aux/meson-dist', meson.project_version(), meson.source_root())
message('Updating submodules')
run_command('build-aux/meson/check-spice-common', check : true)