feat: added commit hash

This commit is contained in:
Yurii
2026-02-16 10:06:26 +03:00
parent af1a9b59c4
commit 11747dd8bd
11 changed files with 32 additions and 1 deletions

16
tools/add_build_commit.py Normal file
View File

@@ -0,0 +1,16 @@
import subprocess
Import("env")
try:
commit_hash = "undefined"
result = subprocess.check_output(
["git", "rev-parse", "--short", "HEAD"]
)
commit_hash = result.decode("utf-8").strip()
env.Append(
CPPDEFINES=[
("BUILD_COMMIT", '\\"{}\\"'.format(commit_hash))
]
)
except Exception as error:
print("Failed to get commit hash: {}".format(error))