meson: better versioning

This commit is contained in:
Mihai Fufezan 2023-10-10 21:37:22 +03:00
parent d39e531e75
commit 0a908acc05
No known key found for this signature in database
1 changed files with 2 additions and 10 deletions

View File

@ -20,22 +20,12 @@ else
error('Could not configure current C++ compiler (' + cpp_compiler.get_id() + ' ' + cpp_compiler.version() + ') with required C++ standard (C++23)')
endif
GIT_BRANCH = run_command('git', 'rev-parse', '--abbrev-ref', 'HEAD', check: false).stdout().strip()
GIT_COMMIT_HASH = run_command('git', 'rev-parse', 'HEAD', check: false).stdout().strip()
GIT_COMMIT_MESSAGE = run_command('sh', '-c', 'git show | head -n 5 | tail -n 1', check: false).stdout().strip()
GIT_DIRTY = run_command('sh', '-c', 'git diff-index --quiet HEAD -- || echo "dirty"', check: false).stdout().strip()
add_project_arguments(
[
'-Wno-unused-parameter',
'-Wno-unused-value',
'-Wno-missing-field-initializers',
'-Wno-narrowing',
f'-DGIT_BRANCH="@GIT_BRANCH@"',
f'-DGIT_COMMIT_HASH="@GIT_COMMIT_HASH@"',
f'-DGIT_COMMIT_MESSAGE="@GIT_COMMIT_MESSAGE@"',
f'-DGIT_DIRTY="@GIT_DIRTY@"',
],
language: 'cpp')
@ -81,6 +71,8 @@ foreach file : headers
install_headers(file, subdir: 'hyprland', preserve_path: true)
endforeach
version_h = run_command('sh', '-c', 'scripts/generateVersion.sh')
subdir('protocols')
subdir('src')
subdir('hyprctl')