1
0
Fork 0

[meson] Check for git availability. Refs #47

This commit is contained in:
Witold Filipczyk 2023-04-22 10:28:40 +02:00
parent 6c7df5b7d4
commit 552917701c
1 changed files with 9 additions and 2 deletions

View File

@ -3,8 +3,15 @@ srcs=[]
srcdir = meson.source_root()
txt = run_command('git', '--git-dir=' + srcdir + '/.git', 'rev-parse', 'HEAD', check:false).stdout().strip()
dirty = run_command(srcdir + '/git-dirty.sh', check:false).stdout().strip()
git = find_program('git', required: false)
if git.found()
txt = run_command('git', '--git-dir=' + srcdir + '/.git', 'rev-parse', 'HEAD', check:false).stdout().strip()
dirty = run_command(srcdir + '/git-dirty.sh', check:false).stdout().strip()
else
txt = ''
dirty = ''
endif
add_global_arguments('-DBUILD_ID="' + txt + dirty + '"', language : 'c')
conf_data = configuration_data()