mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 07:05:58 +01:00
meson: add -DGIT arguments (#321)
This commit is contained in:
parent
ac8e5fef10
commit
0eebf3ab16
2 changed files with 12 additions and 0 deletions
10
meson.build
10
meson.build
|
@ -4,12 +4,22 @@ project('Hyprland', 'cpp', 'c',
|
||||||
|
|
||||||
add_global_arguments('-std=c++23', language: 'cpp')
|
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(
|
add_project_arguments(
|
||||||
[
|
[
|
||||||
'-Wno-unused-parameter',
|
'-Wno-unused-parameter',
|
||||||
'-Wno-unused-value',
|
'-Wno-unused-value',
|
||||||
'-Wno-missing-field-initializers',
|
'-Wno-missing-field-initializers',
|
||||||
'-Wno-narrowing',
|
'-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')
|
language: 'cpp')
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
pkg-config,
|
pkg-config,
|
||||||
meson,
|
meson,
|
||||||
ninja,
|
ninja,
|
||||||
|
git,
|
||||||
libdrm,
|
libdrm,
|
||||||
libinput,
|
libinput,
|
||||||
libxcb,
|
libxcb,
|
||||||
|
@ -36,6 +37,7 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[
|
[
|
||||||
|
git
|
||||||
libdrm
|
libdrm
|
||||||
libinput
|
libinput
|
||||||
libxcb
|
libxcb
|
||||||
|
|
Loading…
Reference in a new issue