diff options
| author | ruki <[email protected]> | 2020-04-22 23:28:31 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-04-22 14:51:11 +0800 |
| commit | a69f20d2daf4ed61b58b036eee7bf20a3034a30e (patch) | |
| tree | 746ddf9af271570521c6a3ac5c49fc5ed507bf52 /tests/projects/xmake_cli/hello/src | |
| parent | 9407f3893ca3f71578febcabdf6a022a80dae209 (diff) | |
add lni module
Diffstat (limited to 'tests/projects/xmake_cli/hello/src')
| -rw-r--r-- | tests/projects/xmake_cli/hello/src/lni/main.c | 11 | ||||
| -rw-r--r-- | tests/projects/xmake_cli/hello/src/lua/main.lua | 4 |
2 files changed, 13 insertions, 2 deletions
diff --git a/tests/projects/xmake_cli/hello/src/lni/main.c b/tests/projects/xmake_cli/hello/src/lni/main.c index 1d574dc1b..a2601687a 100644 --- a/tests/projects/xmake_cli/hello/src/lni/main.c +++ b/tests/projects/xmake_cli/hello/src/lni/main.c @@ -22,6 +22,7 @@ tb_int_t main(tb_int_t argc, tb_char_t** argv) xm_engine_ref_t engine = xm_engine_init(lni_initalizer); if (engine) { +#if 0 tb_int_t argc2 = argc + 2; tb_char_t* argv2[argc2 + 1]; argv2[0] = argv[0]; @@ -29,6 +30,16 @@ tb_int_t main(tb_int_t argc, tb_char_t** argv) argv2[2] = "lua.main"; if (argc > 1) tb_memcpy(argv2 + 3, argv + 1, (argc - 1) * sizeof(tb_char_t*)); argv2[argc2] = tb_null; +#else + tb_int_t argc2 = argc + 3; + tb_char_t* argv2[argc2 + 1]; + argv2[0] = argv[0]; + argv2[1] = "lua"; + argv2[2] = "-vD"; + argv2[3] = "lua.main"; + if (argc > 1) tb_memcpy(argv2 + 4, argv + 1, (argc - 1) * sizeof(tb_char_t*)); + argv2[argc2] = tb_null; +#endif ok = xm_engine_main(engine, argc2, argv2); xm_engine_exit(engine); } diff --git a/tests/projects/xmake_cli/hello/src/lua/main.lua b/tests/projects/xmake_cli/hello/src/lua/main.lua index 26ba586a2..0a1590543 100644 --- a/tests/projects/xmake_cli/hello/src/lua/main.lua +++ b/tests/projects/xmake_cli/hello/src/lua/main.lua @@ -1,8 +1,8 @@ import("core.base.option") -import("lib.lni.test") +import("lib.lni") function main () - print(test) + print(lni) print("hello xmake!") local argv = option.get("arguments") if argv then |
