|
|
@@ -10,9 +10,21 @@ |
|
|
|
*/ |
|
|
|
|
|
|
|
#include "megbrain/version.h" |
|
|
|
#include "megbrain/common.h" |
|
|
|
|
|
|
|
using namespace mgb; |
|
|
|
|
|
|
|
//! some sdk do not call mgb::get_version explicitly, so we force show version for |
|
|
|
//! debug, mgb_log level is info, sdk may config a higher, need export |
|
|
|
//! RUNTIME_OVERRIDE_LOG_LEVEL=0 to force change log level to show version |
|
|
|
#ifndef __IN_TEE_ENV__ |
|
|
|
static __attribute__((constructor)) void show_version() { |
|
|
|
auto v = get_version(); |
|
|
|
mgb_log("init Engine with version: %d.%d.%d(%d) at git commitid: %s", v.major, |
|
|
|
v.minor, v.patch, v.is_dev, GIT_FULL_HASH); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
Version mgb::get_version() { |
|
|
|
#ifdef MGB_MAJOR |
|
|
|
return {MGB_MAJOR, MGB_MINOR, MGB_PATCH, MGB_IS_DEV}; |
|
|
|