summaryrefslogtreecommitdiff
path: root/xmake/rules/zig/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-12-08 00:29:44 +0800
committerruki <[email protected]>2020-12-08 00:29:44 +0800
commitdc224a6dbb7a8f4fd0ecf41b5dd4d3c3ec7c465d (patch)
tree106dbbe5e057c95ad6ab8d013aa361ef9c490fa5 /xmake/rules/zig/xmake.lua
parent1858fb1601354b7444ca79f01a54b2d505ccf98c (diff)
modify zig-cache directory
Diffstat (limited to 'xmake/rules/zig/xmake.lua')
-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