summaryrefslogtreecommitdiff
path: root/xmake/rules/xcode
diff options
context:
space:
mode:
authorruki <[email protected]>2021-08-22 21:43:26 +0800
committerruki <[email protected]>2021-08-22 21:43:26 +0800
commit8b9dbad9c63b940478815c86fc04ad809495b8d6 (patch)
tree4461a55e184e87011871f5cb793eddae5981466a /xmake/rules/xcode
parentdf288a44eb6c8277d250306add709f9f5f59f0cd (diff)
generate default.metallib
Diffstat (limited to 'xmake/rules/xcode')
-rw-r--r--xmake/rules/xcode/metal/xmake.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/rules/xcode/metal/xmake.lua b/xmake/rules/xcode/metal/xmake.lua
index a8b1fe16d..8892746f8 100644
--- a/xmake/rules/xcode/metal/xmake.lua
+++ b/xmake/rules/xcode/metal/xmake.lua
@@ -80,8 +80,9 @@ rule("xcode.metal")
assert(#objectfiles > 0, "*.air files not found!")
-- add commands
- local libraryfile = "default.metallib"
- batchcmds:show_progress(opt.progress, "${color.build.target}linking.metal %s", libraryfile)
+ local resourcesdir = path.absolute(target:data("xcode.bundle.resourcesdir"))
+ local libraryfile = resourcesdir and path.join(resourcesdir, "default.metallib") or (target:targetfile() .. ".metallib")
+ batchcmds:show_progress(opt.progress, "${color.build.target}linking.metal %s", path.filename(libraryfile))
batchcmds:mkdir(path.directory(libraryfile))
batchcmds:vrunv(metallib.program, table.join({"-o", libraryfile}, objectfiles))