summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2015-11-26 09:29:26 +0800
committerruki <[email protected]>2015-11-26 09:29:26 +0800
commit834f71c6e70e62c719060d0cf5bed34fe715fb16 (patch)
tree544bcde42984f1a7dfd3676d5e84bfcdbc2ba67a /core/src
parente22f1e2d6f637f388db226c94ac185f6f5f8bbcc (diff)
modify version
Diffstat (limited to 'core/src')
-rwxr-xr-xcore/src/xmake/machine.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/src/xmake/machine.c b/core/src/xmake/machine.c
index b32a05dfa..7e5cae462 100755
--- a/core/src/xmake/machine.c
+++ b/core/src/xmake/machine.c
@@ -286,6 +286,17 @@ xm_machine_ref_t xm_machine_init()
#endif
lua_setglobal(impl->lua, "_NULDEV");
+ // init version
+ tb_version_t const* version = xm_version();
+ if (version)
+ {
+ tb_char_t version_cstr[256] = {0};
+ tb_snprintf(version_cstr, sizeof(version_cstr), "XMake v%u.%u.%u.%llu", version->major, version->minor, version->alter, version->build);
+ lua_pushstring(impl->lua, version_cstr);
+ }
+ else lua_pushstring(impl->lua, "XMake");
+ lua_setglobal(impl->lua, "_VERSION");
+
// init namespace: xmake
lua_newtable(impl->lua);
lua_setglobal(impl->lua, "xmake");