Skip to content

Commit f279f50

Browse files
committed
add bin2c xmake.xmz
1 parent e1c5ce3 commit f279f50

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

core/src/demo/xmake.lua

-14
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,3 @@ target("demo")
8888
end
8989
end)
9090

91-
-- embed all script files
92-
add_rules("utils.bin2c", {linewidth = 16, extensions = ".xmz"})
93-
on_config(function (target)
94-
import("utils.archive.archive")
95-
if has_config("embed") then
96-
local archivefile = path.join(target:autogendir(), "bin2c", "xmake.xmz")
97-
print("archiving %s ..", archivefile)
98-
os.tryrm(archivefile)
99-
local rootdir = path.normalize(path.join(os.projectdir(), "..", "xmake"))
100-
archive(archivefile, rootdir, {recurse = true, curdir = rootdir})
101-
target:add("files", archivefile)
102-
target:add("defines", "XM_EMBED_ENABLE=1")
103-
end
104-
end)

core/src/xmake/engine.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ tb_int_t xm_engine_main(xm_engine_ref_t self, tb_int_t argc, tb_char_t** argv, t
13391339
}
13401340

13411341
#ifdef XM_EMBED_ENABLE
1342-
tb_trace_i("g_xmake_xmz_data: %d", sizeof(g_xmake_xmz_data));
1342+
tb_trace_i("g_xmake_xmz_data: %p", g_xmake_xmz_data);
13431343
#endif
13441344

13451345
// get the error code

core/src/xmake/xmake.lua

+14
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,17 @@ target("xmake")
5555
add_defines("UNICODE", "_UNICODE")
5656
end
5757

58+
-- embed all script files
59+
add_rules("utils.bin2c", {linewidth = 16, extensions = ".xmz"})
60+
on_config(function (target)
61+
import("utils.archive.archive")
62+
if has_config("embed") then
63+
local archivefile = path.join(target:autogendir(), "bin2c", "xmake.xmz")
64+
print("archiving %s ..", archivefile)
65+
os.tryrm(archivefile)
66+
local rootdir = path.normalize(path.join(os.projectdir(), "..", "xmake"))
67+
archive(archivefile, rootdir, {recurse = true, curdir = rootdir})
68+
target:add("files", archivefile)
69+
target:add("defines", "XM_EMBED_ENABLE=1")
70+
end
71+
end)

0 commit comments

Comments
 (0)