Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I would like to override the default Xcode Metal compiler behaviour of compiling all project .metal files into a single default.metallib and instead compile each .metal file into a separate .metallib file.

However I cannot see how to approach this; can anyone provide a lead?

Xcode version: 10.1

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

I achieved this in two steps:

1) Add a custom build rule for .metal files that compiles them individually into .metallibs:

enter image description here

2) Add a custom build step for copying those .metallibs into your target:

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...