Include Git hash in the engine

This commit is contained in:
Poommetee Ketson
2017-07-10 15:47:38 +07:00
parent 159b1fc65f
commit 5a9eb5ef58
3 changed files with 23 additions and 1 deletions

View File

@ -30,6 +30,7 @@
#include "engine.h"
#include "version.h"
#include "version_hash.gen.h"
void Engine::set_iterations_per_second(int p_ips) {
@ -87,6 +88,9 @@ Dictionary Engine::get_version_info() const {
dict["revision"] = _MKSTR(VERSION_REVISION);
dict["year"] = VERSION_YEAR;
String hash = String(VERSION_HASH);
dict["hash"] = hash.length() == 0 ? String("unknown") : hash;
String stringver = String(dict["major"]) + "." + String(dict["minor"]);
if ((int)dict["patch"] != 0)
stringver += "." + String(dict["patch"]);