diff options
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 9bc80a8a..2ab36e18 100644 --- a/meson.build +++ b/meson.build @@ -4,12 +4,22 @@ project('Hyprland', 'cpp', 'c', add_global_arguments('-std=c++23', language: 'cpp') +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('bash', '-c', 'git show | head -n 5 | tail -n 1', check: false).stdout().strip() +GIT_DIRTY = run_command('bash', '-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') |