summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/xmake/engine.c9
-rw-r--r--core/src/xmake/xmake.lua4
2 files changed, 6 insertions, 7 deletions
diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c
index b7d071b65..530071a68 100644
--- a/core/src/xmake/engine.c
+++ b/core/src/xmake/engine.c
@@ -714,9 +714,8 @@ static lua_State *g_lua = tb_null;
// the xmake script files data
#ifdef XM_EMBED_ENABLE
-static tb_byte_t g_xmake_xmz_data[] = {
-#include "xmake.xmz.h"
-};
+extern tb_byte_t _binary_xmake_xmz_start[];
+extern tb_byte_t _binary_xmake_xmz_end[];
#endif
/* //////////////////////////////////////////////////////////////////////////////////////
@@ -1401,8 +1400,8 @@ static tb_bool_t xm_engine_extract_programfiles_impl(xm_engine_t *engine,
static tb_bool_t xm_engine_extract_programfiles(xm_engine_t *engine, tb_char_t const *programdir) {
tb_file_info_t info = { 0 };
if (!tb_file_info(programdir, &info)) {
- tb_byte_t const *data = g_xmake_xmz_data;
- tb_size_t size = sizeof(g_xmake_xmz_data);
+ tb_byte_t const *data = _binary_xmake_xmz_start;
+ tb_size_t size = _binary_xmake_xmz_end - _binary_xmake_xmz_start;
if (!xm_engine_extract_programfiles_impl(engine, programdir, data, size)) {
return tb_false;
}
diff --git a/core/src/xmake/xmake.lua b/core/src/xmake/xmake.lua
index 0883d071b..90f761b30 100644
--- a/core/src/xmake/xmake.lua
+++ b/core/src/xmake/xmake.lua
@@ -61,11 +61,11 @@ target("xmake")
end
-- embed all script files
- add_rules("utils.bin2c", {linewidth = 16, extensions = ".xmz"})
+ add_rules("utils.bin2obj", {extensions = ".xmz"})
on_config(function (target)
import("utils.archive.archive")
if has_config("embed") then
- local archivefile = path.join(target:autogendir(), "bin2c", "xmake.xmz")
+ local archivefile = path.join(target:autogendir(), "bin2obj", "xmake.xmz")
print("archiving %s ..", archivefile)
os.tryrm(archivefile)
local rootdir = path.normalize(path.join(os.projectdir(), "..", "xmake"))