diff options
Diffstat (limited to 'meson.build')
| -rw-r--r-- | meson.build | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/meson.build b/meson.build index 85dfe00..6fffcff 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,7 @@ project( 'swaylock', 'c', + version: '1.3', license: 'MIT', meson_version: '>=0.48.0', default_options: [ @@ -47,17 +48,12 @@ git = find_program('git', required: false) scdoc = find_program('scdoc', required: get_option('man-pages')) wayland_scanner = find_program('wayland-scanner') -version = get_option('swaylock-version') -if version != '' - version = '"@0@"'.format(version) -else - if not git.found() - error('git is required to make the version string') - endif - +if git.found() git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags']).stdout().strip() git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip() version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch) +else + version = '"@0@"'.format(meson.project_version()) endif add_project_arguments('-DSWAYLOCK_VERSION=@0@'.format(version), language: 'c') |
