mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
build-sys: Fix meson version detection logic
This sync the meson version detection to match what we do in the autotools build, which is to use git-version-gen, which in turn looks for <topdir>/.tarball-version, or generates the version based on a git tag or environment variable.
This commit is contained in:
parent
c46e95ca63
commit
56c1e7c615
1 changed files with 13 additions and 6 deletions
19
meson.build
19
meson.build
|
|
@ -1,14 +1,21 @@
|
|||
project('pulseaudio', 'c', 'cpp',
|
||||
version : '10.99.1',
|
||||
version : run_command(find_program('git-version-gen'), join_paths(meson.current_source_dir(), '.tarball-version')).stdout().strip(),
|
||||
meson_version : '>= 0.44.0',
|
||||
default_options : [ 'c_std=gnu11', 'cpp_std=c++11' ]
|
||||
)
|
||||
|
||||
pa_version = meson.project_version()
|
||||
version_split = pa_version.split('.')
|
||||
pa_version_major = version_split[0]
|
||||
pa_version_str = meson.project_version()
|
||||
# For tarballs, the first split will do nothing, but for builds in git, we
|
||||
# split out suffixes when there are commits since the last tag
|
||||
# (e.g.: v11.99.1-3-gad14bdb24 -> v11.99.1)
|
||||
version_split = pa_version_str.split('-')[0].split('.')
|
||||
pa_version_major = version_split[0].split('v')[0]
|
||||
pa_version_minor = version_split[1]
|
||||
pa_version_micro = version_split[2]
|
||||
if version_split.length() > 2
|
||||
pa_version_micro = version_split[2]
|
||||
else
|
||||
pa_version_micro = '0'
|
||||
endif
|
||||
pa_version_major_minor = pa_version_major + '.' + pa_version_minor
|
||||
|
||||
pa_api_version = 12
|
||||
|
|
@ -31,7 +38,7 @@ cc = meson.get_compiler('c')
|
|||
cdata = configuration_data()
|
||||
cdata.set_quoted('PACKAGE', 'pulseaudio')
|
||||
cdata.set_quoted('PACKAGE_NAME', 'pulseaudio')
|
||||
cdata.set_quoted('PACKAGE_VERSION', pa_version)
|
||||
cdata.set_quoted('PACKAGE_VERSION', pa_version_str)
|
||||
cdata.set_quoted('CANONICAL_HOST', host_machine.cpu())
|
||||
cdata.set('PA_MAJOR', pa_version_major)
|
||||
cdata.set('PA_MINOR', pa_version_minor)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue