mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 15:25:54 -04:00
dtoolutil: Allow overriding PandaSystem::get_build_date()
This is useful to create bit-for-bit reproducible builds. In the buildbots, we set it to the timestamp of the latest commit.
This commit is contained in:
parent
6520b68c2c
commit
54638bfc10
@ -268,7 +268,11 @@ get_compiler() {
|
||||
*/
|
||||
string PandaSystem::
|
||||
get_build_date() {
|
||||
#ifdef PANDA_BUILD_DATE_STR
|
||||
return PANDA_BUILD_DATE_STR;
|
||||
#else
|
||||
return __DATE__ " " __TIME__;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3001,6 +3001,14 @@ def CreatePandaVersionFiles():
|
||||
if GIT_COMMIT:
|
||||
pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
|
||||
|
||||
# Allow creating a deterministic build by setting this.
|
||||
source_date = os.environ.get("SOURCE_DATE_EPOCH")
|
||||
if source_date:
|
||||
# This matches the GCC / Clang format for __DATE__ __TIME__
|
||||
source_date = time.gmtime(int(source_date))
|
||||
source_date = time.strftime('%b %e %Y %H:%M:%S', source_date)
|
||||
pandaversion_h += "\n#define PANDA_BUILD_DATE_STR \"%s\"\n" % (source_date)
|
||||
|
||||
if not RUNTIME:
|
||||
checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
|
||||
checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
|
||||
|
Loading…
x
Reference in New Issue
Block a user