aboutsummaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2017-11-30 04:48:08 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2017-11-30 04:48:08 -0500
commit739bafbd8ecdbbf2eb3fd42e1b3d9249236a3fcf (patch)
tree46834d9699a6aabb05721ba77dad59c438b88c60 /meson.build
parentmeson add version info (diff)
downloadsway-739bafbd8ecdbbf2eb3fd42e1b3d9249236a3fcf.tar.gz
sway-739bafbd8ecdbbf2eb3fd42e1b3d9249236a3fcf.tar.zst
sway-739bafbd8ecdbbf2eb3fd42e1b3d9249236a3fcf.zip
make meson version configurable
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build16
1 files changed, 13 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index af383fbf..ac161987 100644
--- a/meson.build
+++ b/meson.build
@@ -23,10 +23,20 @@ pango = dependency('pango')
23pixman = dependency('pixman-1') 23pixman = dependency('pixman-1')
24libcap = dependency('libcap') 24libcap = dependency('libcap')
25math = cc.find_library('m') 25math = cc.find_library('m')
26git = find_program('git', required: false)
26 27
27git_commit_hash = run_command(['git', 'describe', '--always', '--tags']).stdout().strip() 28version = get_option('sway_version')
28git_branch = run_command(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip() 29if version != ''
29version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch) 30 version = '"@0@"'.format(version)
31else
32 if not git.found()
33 error('git is required to make the version string')
34 endif
35
36 git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags']).stdout().strip()
37 git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip()
38 version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch)
39endif
30 40
31add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') 41add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')
32 42