meson.build: add rev-parse to version number

This commit is contained in:
Johan Malm 2021-03-17 21:21:49 +00:00
parent d839889972
commit 1cb8095bb7

View file

@ -27,6 +27,13 @@ add_project_arguments(cc.get_supported_arguments(
)
version='"@0@"'.format(meson.project_version())
git = find_program('git', native: true, required: false)
if git.found()
git_commit = run_command([git, 'describe', '--dirty'])
if git_commit.returncode() == 0
version = '"@0@"'.format(git_commit.stdout().strip())
endif
endif
add_project_arguments('-DLABWC_VERSION=@0@'.format(version), language: 'c')
wlroots_proj = subproject(