Display the build date in the editor and when starting the engine

This can be used to quickly see how recent a development build is,
without having to look up the commit date manually.
When juggling around with various builds (e.g. for benchmarking),
this can also be used to ensure that you're actually running the
binary you intended to run.

The date stored is the date of the Git commit that is built, not
the current date at the time of building the binary. This ensures
binaries can remain reproducible.

The version timestamp can be accessed using the `timestamp` key
of the `Engine.get_version_info()` return value.
This commit is contained in:
Hugo Locurcio 2022-03-12 02:04:14 +01:00
parent 8f3e2a6113
commit 67e9ccdbc4
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
9 changed files with 69 additions and 7 deletions

View file

@ -33,6 +33,8 @@
#include "core/version_generated.gen.h"
#include <stdint.h>
// Copied from typedefs.h to stay lean.
#ifndef _STR
#define _STR(m_x) #m_x
@ -77,4 +79,8 @@
// Git commit hash, generated at build time in `core/version_hash.gen.cpp`.
extern const char *const VERSION_HASH;
// Git commit date UNIX timestamp (in seconds), generated at build time in `core/version_hash.gen.cpp`.
// Set to 0 if unknown.
extern const uint64_t VERSION_TIMESTAMP;
#endif // VERSION_H