diff options
| author | ruki <[email protected]> | 2025-09-09 23:18:20 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-09-09 23:18:20 +0800 |
| commit | b955555506146d36457e969b21961d4bc9686bfb (patch) | |
| tree | 24093763ecbee6c08d6ac19d5db2bca4dfad095e | |
| parent | 8b0ad9473d32b6ed8ace1c68b589b38afcb65b16 (diff) | |
skip embed binary
| -rw-r--r-- | core/src/xmake/engine.c | 3 | ||||
| -rw-r--r-- | tests/benchmarks/build_targets/test.lua | 4 | ||||
| -rw-r--r-- | tests/benchmarks/config_targets/test.lua | 4 | ||||
| -rw-r--r-- | xmake/core/_xmake_main.lua | 1 | ||||
| -rw-r--r-- | xmake/core/base/xmake.lua | 5 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/xmake.lua | 1 |
6 files changed, 18 insertions, 0 deletions
diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c index ee07da6ea..19011d595 100644 --- a/core/src/xmake/engine.c +++ b/core/src/xmake/engine.c @@ -1558,6 +1558,9 @@ xm_engine_ref_t xm_engine_init(tb_char_t const* name, xm_engine_lni_initalizer_c // init the temporary directory if (!xm_engine_get_temporary_directory(engine->tmpdir, sizeof(engine->tmpdir), name, version_cstr)) break; + + lua_pushboolean(engine->lua, tb_true); + lua_setglobal(engine->lua, "_EMBED"); #endif // init short version string diff --git a/tests/benchmarks/build_targets/test.lua b/tests/benchmarks/build_targets/test.lua index 4e8fa476e..1804dd59c 100644 --- a/tests/benchmarks/build_targets/test.lua +++ b/tests/benchmarks/build_targets/test.lua @@ -3,6 +3,10 @@ import("core.tool.toolchain") function test_build(t) + if xmake.is_embed() then + return + end + -- xmake os.tryrm("build") local xmake_dt = os.mclock() diff --git a/tests/benchmarks/config_targets/test.lua b/tests/benchmarks/config_targets/test.lua index 1963ae98a..983f7f952 100644 --- a/tests/benchmarks/config_targets/test.lua +++ b/tests/benchmarks/config_targets/test.lua @@ -3,6 +3,10 @@ import("core.tool.toolchain") function test_config(t) + if xmake.is_embed() then + return + end + -- xmake os.tryrm("build") local xmake_dt = os.mclock() diff --git a/xmake/core/_xmake_main.lua b/xmake/core/_xmake_main.lua index a2bbe8e00..00538c864 100644 --- a/xmake/core/_xmake_main.lua +++ b/xmake/core/_xmake_main.lua @@ -36,6 +36,7 @@ xmake._PROJECT_FILE = "xmake.lua" xmake._WORKING_DIR = os.curdir() xmake._FEATURES = _FEATURES xmake._LUAJIT = _LUAJIT +xmake._EMBED = _EMBED xmake._THREAD_CALLBACK = _THREAD_CALLBACK xmake._THREAD_CALLINFO = _THREAD_CALLINFO diff --git a/xmake/core/base/xmake.lua b/xmake/core/base/xmake.lua index 008e6596d..8aab7cdd8 100644 --- a/xmake/core/base/xmake.lua +++ b/xmake/core/base/xmake.lua @@ -62,6 +62,11 @@ function xmake.luajit() return xmake._LUAJIT end +-- is embed? +function xmake.is_embed() + return xmake._EMBED +end + -- get command arguments function xmake.argv() return xmake._ARGV diff --git a/xmake/core/sandbox/modules/xmake.lua b/xmake/core/sandbox/modules/xmake.lua index 32c8d0f4d..8c040a9a0 100644 --- a/xmake/core/sandbox/modules/xmake.lua +++ b/xmake/core/sandbox/modules/xmake.lua @@ -31,6 +31,7 @@ sandbox_xmake.branch = xmake.branch sandbox_xmake.programdir = xmake.programdir sandbox_xmake.programfile = xmake.programfile sandbox_xmake.luajit = xmake.luajit +sandbox_xmake.is_embed = xmake.is_embed sandbox_xmake.argv = xmake.argv -- return module |
