1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-18 13:55:36 -05:00

Use predefined version when not building from git repo

This commit is contained in:
Yuxuan Shui 2018-10-17 00:17:40 +01:00
parent 0b866fb17f
commit 47a49ed6f9

View file

@ -1,8 +1,20 @@
project('compton', 'c')
project('compton', 'c', version: '2')
cc = meson.get_compiler('c')
version = run_command('git', 'describe').stdout().strip()
version = ''
git = find_program('git', required: false)
if git.found()
gitv = run_command('git', 'describe')
if gitv.returncode() == 0
version = gitv.stdout().strip()
endif
endif
if version == ''
# use project version by default
version = 'v'+meson.project_version()
endif
add_global_arguments('-std=c11', language: 'c')
add_global_arguments('-DCOMPTON_VERSION="'+version+'"', language: 'c')