2022-06-26 12:00:03 +00:00
|
|
|
from SCons.Builder import Builder
|
|
|
|
from SCons.Action import Action
|
|
|
|
|
|
|
|
|
|
|
|
def version_emitter(target, source, env):
|
|
|
|
target_dir = target[0]
|
|
|
|
target = [
|
|
|
|
target_dir.File("version.inc.h"),
|
|
|
|
target_dir.File("version.json"),
|
|
|
|
]
|
|
|
|
return target, source
|
|
|
|
|
|
|
|
|
|
|
|
def generate(env):
|
|
|
|
env.Append(
|
|
|
|
BUILDERS={
|
|
|
|
"VersionBuilder": Builder(
|
|
|
|
action=Action(
|
2022-07-25 21:31:34 +00:00
|
|
|
'${PYTHON3} "${ROOT_DIR.abspath}/scripts/version.py" generate -t ${TARGET_HW} -o ${TARGET.dir.posix} --dir "${ROOT_DIR}"',
|
2022-06-26 12:00:03 +00:00
|
|
|
"${VERSIONCOMSTR}",
|
|
|
|
),
|
|
|
|
emitter=version_emitter,
|
|
|
|
),
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def exists(env):
|
|
|
|
return True
|