mirror of
https://github.com/BitMaker-hub/NerdMiner_v2.git
synced 2025-03-26 01:31:44 +01:00
18 lines
629 B
Python
18 lines
629 B
Python
import subprocess
|
|
|
|
Import("env")
|
|
|
|
def get_firmware_specifier_build_flag():
|
|
ret = subprocess.run(["git", "describe"], stdout=subprocess.PIPE, text=True) #Uses only annotated tags
|
|
#ret = subprocess.run(["git", "describe", "--tags"], stdout=subprocess.PIPE, text=True) #Uses any tags
|
|
build_version = ret.stdout.strip()
|
|
# fix unwanted and verbose tags
|
|
build_version = build_version.replace('Release', '')
|
|
build_flag = "-D AUTO_VERSION=\\\"" + build_version + "\\\""
|
|
print ("Firmware Revision: " + build_version)
|
|
return (build_flag)
|
|
|
|
env.Append(
|
|
BUILD_FLAGS=[get_firmware_specifier_build_flag()]
|
|
)
|