summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/rules/zig/xmake.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/xmake/rules/zig/xmake.lua b/xmake/rules/zig/xmake.lua
index 43d25f55c..0f1d6848d 100644
--- a/xmake/rules/zig/xmake.lua
+++ b/xmake/rules/zig/xmake.lua
@@ -21,6 +21,11 @@
-- define rule: zig.build
rule("zig.build")
set_sourcekinds("zc")
+ on_load(function (target)
+ local cachedir = target:values("zig.cachedir") or path.join(target:objectdir(), "zig-cache")
+ os.mkdir(cachedir)
+ target:add("zcflags", "--cache-dir " .. cachedir)
+ end)
on_build_files("private.action.build.object", {batch = true})
-- define rule: zig