From 86d1ecf783f8fd164ed63501c859b65cfc6bc022 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Thu, 30 Nov 2017 04:29:32 -0500 Subject: [PATCH] meson add version info --- meson.build | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 6f2681af..af383fbf 100644 --- a/meson.build +++ b/meson.build @@ -24,8 +24,11 @@ pixman = dependency('pixman-1') libcap = dependency('libcap') math = cc.find_library('m') -# TODO version -add_project_arguments('-DSWAY_VERSION="5"', language: 'c') +git_commit_hash = run_command(['git', 'describe', '--always', '--tags']).stdout().strip() +git_branch = run_command(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip() +version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch) + +add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') sway_inc = include_directories('include')