diff options
| author | ruki <[email protected]> | 2024-08-22 00:51:11 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-08-22 00:51:11 +0800 |
| commit | f279f505880fc1c7390a67b445c2a934fcb04302 (patch) | |
| tree | d451ac734f204a42f997a9c89f262c998e5c0b33 | |
| parent | e1c5ce34cdac1353f8c30a5842b51eb5e3e53d28 (diff) | |
add bin2c xmake.xmz
| -rw-r--r-- | core/src/demo/xmake.lua | 14 | ||||
| -rw-r--r-- | core/src/xmake/engine.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/xmake.lua | 14 |
3 files changed, 15 insertions, 15 deletions
diff --git a/core/src/demo/xmake.lua b/core/src/demo/xmake.lua index 92e68aee1..f519dd88a 100644 --- a/core/src/demo/xmake.lua +++ b/core/src/demo/xmake.lua @@ -88,17 +88,3 @@ target("demo") end end) - -- embed all script files - add_rules("utils.bin2c", {linewidth = 16, extensions = ".xmz"}) - on_config(function (target) - import("utils.archive.archive") - if has_config("embed") then - local archivefile = path.join(target:autogendir(), "bin2c", "xmake.xmz") - print("archiving %s ..", archivefile) - os.tryrm(archivefile) - local rootdir = path.normalize(path.join(os.projectdir(), "..", "xmake")) - archive(archivefile, rootdir, {recurse = true, curdir = rootdir}) - target:add("files", archivefile) - target:add("defines", "XM_EMBED_ENABLE=1") - end - end) diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c index 5c6c11c54..2197867f1 100644 --- a/core/src/xmake/engine.c +++ b/core/src/xmake/engine.c @@ -1339,7 +1339,7 @@ tb_int_t xm_engine_main(xm_engine_ref_t self, tb_int_t argc, tb_char_t** argv, t } #ifdef XM_EMBED_ENABLE - tb_trace_i("g_xmake_xmz_data: %d", sizeof(g_xmake_xmz_data)); + tb_trace_i("g_xmake_xmz_data: %p", g_xmake_xmz_data); #endif // get the error code diff --git a/core/src/xmake/xmake.lua b/core/src/xmake/xmake.lua index af0bfd877..f5f2d9699 100644 --- a/core/src/xmake/xmake.lua +++ b/core/src/xmake/xmake.lua @@ -55,3 +55,17 @@ target("xmake") add_defines("UNICODE", "_UNICODE") end + -- embed all script files + add_rules("utils.bin2c", {linewidth = 16, extensions = ".xmz"}) + on_config(function (target) + import("utils.archive.archive") + if has_config("embed") then + local archivefile = path.join(target:autogendir(), "bin2c", "xmake.xmz") + print("archiving %s ..", archivefile) + os.tryrm(archivefile) + local rootdir = path.normalize(path.join(os.projectdir(), "..", "xmake")) + archive(archivefile, rootdir, {recurse = true, curdir = rootdir}) + target:add("files", archivefile) + target:add("defines", "XM_EMBED_ENABLE=1") + end + end) |
