]> git.mdlowis.com Git - proto/labwc.git/commitdiff
meson.build: add rev-parse to version number
authorJohan Malm <jgm323@gmail.com>
Wed, 17 Mar 2021 21:21:49 +0000 (21:21 +0000)
committerJohan Malm <jgm323@gmail.com>
Wed, 17 Mar 2021 21:21:49 +0000 (21:21 +0000)
meson.build

index c8918a584eb10ea8846534083509b8c96fb0c653..1aa737e67ed5ccf9a136b4f91bc635faa4bc3073 100644 (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(