I’m trying to get a dynamic value like build time stamp or git commit version into the firmware. I thought the build_flags with the -D option combined with the extra script would be the right choice but for some reason the variable doesn’t get replaced.
extra_script = timestamp.py
And in timestamp.py:
from SCons.Script import DefaultEnvironment
env = DefaultEnvironment()
env.Replace(build_flags = ‘-D BUILD_TIMESTAMP=111’)
But BUILD_TIMESTAMP doesn’t get replaced and the printing BUILD_TIMESTAMP returns 0. Any ideas? Or any better option to get a value identifying the current build into the firmware? This should also work for the CI build…