summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-09-04 23:13:24 +0800
committerruki <[email protected]>2025-09-04 22:30:35 +0800
commit8ffee17dab287bccd050622bfd62b1cac53c8fcd (patch)
tree710cbc3ccfbe5ce0900cb28267443d69fb8a6336
parent7260c2d4f475146c4bc388787be28d7f68e8ca33 (diff)
improve batchcmds
-rw-r--r--xmake/plugins/project/utils/target_cmds.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/plugins/project/utils/target_cmds.lua b/xmake/plugins/project/utils/target_cmds.lua
index ab1f8b42a..25413912a 100644
--- a/xmake/plugins/project/utils/target_cmds.lua
+++ b/xmake/plugins/project/utils/target_cmds.lua
@@ -79,6 +79,16 @@ function get_target_buildcmds(target, opt)
end
end
end
+ -- translate batchcmds:lua to batchcmds:runv, we need to generate executable commmand
+ for _, cmd in ipairs(buildcmds:cmds()) do
+ local kind = cmd.kind
+ if cmd.script and (kind == "lua" or kind == "vlua") then
+ cmd.kind = (kind == "vlua") and "vrunv" or "runv"
+ cmd.program = os.programfile()
+ cmd.argv = table.join("lua", cmd.script, cmd.argv)
+ cmd.script = nil
+ end
+ end
return buildcmds:cmds()
end