From 94262ef203d602f0ae84433b834173373633bebf Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 7 Feb 2025 00:50:37 +0800 Subject: improve embed files for lni --- tests/projects/xmake_cli/hello/src/lni/main.c | 3 ++- tests/projects/xmake_cli/hello/xmake.lua | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/projects/xmake_cli/hello/src/lni/main.c b/tests/projects/xmake_cli/hello/src/lni/main.c index 8996d83d3..d61d60dac 100644 --- a/tests/projects/xmake_cli/hello/src/lni/main.c +++ b/tests/projects/xmake_cli/hello/src/lni/main.c @@ -1,6 +1,6 @@ #include -static unsigned char g_luafiles_data[] = { +static tb_byte_t const g_luafiles_data[] = { #include "luafiles.xmz.h" }; @@ -15,6 +15,7 @@ static tb_void_t lni_initalizer(xm_engine_ref_t engine, lua_State* lua) { , {tb_null, tb_null} }; xm_engine_register(engine, "test", lni_test_funcs); + xm_engine_add_embedfiles(engine, g_luafiles_data, sizeof(g_luafiles_data)); } tb_int_t main(tb_int_t argc, tb_char_t** argv) { diff --git a/tests/projects/xmake_cli/hello/xmake.lua b/tests/projects/xmake_cli/hello/xmake.lua index c40a2826d..9923c85f7 100644 --- a/tests/projects/xmake_cli/hello/xmake.lua +++ b/tests/projects/xmake_cli/hello/xmake.lua @@ -5,6 +5,6 @@ add_requires("libxmake") target("hello") add_rules("xmake.cli") add_files("src/lni/*.c") - add_files("src/lua/*.lua") + add_files("src/lua/*.lua", {rootdir = "src"}) add_packages("libxmake") -- cgit v1.3.1