mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-26 12:13:10 +00:00
Move version constants into its own compile-unit
Speeds up the build by moving those constants into a separate compile-unit. Currently, since the version header is auto regenerated on each build, all modules that include it, also have to be recompiled every time.
This commit is contained in:
@@ -2,7 +2,7 @@ import os
|
||||
import subprocess
|
||||
from time import time
|
||||
|
||||
FILENAME_VERSION_H = 'lib/AmsConfiguration/include/version.h'
|
||||
FILENAME_VERSION_H = 'lib/FirmwareVersion/src/generated_version.h'
|
||||
version = os.environ.get('GITHUB_TAG')
|
||||
if version == None:
|
||||
try:
|
||||
@@ -15,9 +15,7 @@ if version == None:
|
||||
version = "SNAPSHOT"
|
||||
|
||||
hf = """
|
||||
#ifndef VERSION
|
||||
#define VERSION "{}"
|
||||
#endif
|
||||
#define VERSION_STRING "{}"
|
||||
#define BUILD_EPOCH {}
|
||||
""".format(version, round(time()))
|
||||
with open(FILENAME_VERSION_H, 'w+') as f:
|
||||
|
||||
Reference in New Issue
Block a user