16 lines
340 B
Python
16 lines
340 B
Python
|
|
Import("env")
|
||
|
|
import subprocess
|
||
|
|
|
||
|
|
config = env.GetProjectConfig()
|
||
|
|
version = config.get("crosspoint", "version")
|
||
|
|
|
||
|
|
result = subprocess.run(
|
||
|
|
["git", "rev-parse", "--short", "HEAD"],
|
||
|
|
capture_output=True, text=True
|
||
|
|
)
|
||
|
|
git_hash = result.stdout.strip()
|
||
|
|
|
||
|
|
env.Append(
|
||
|
|
BUILD_FLAGS=[f'-DCROSSPOINT_VERSION=\\"{version}-mod+{git_hash}\\"']
|
||
|
|
)
|