Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile each .metal file into a separate .metallib

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

like image 319
trojanfoe Avatar asked Feb 27 '19 21:02

trojanfoe


1 Answers

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

like image 200
Frank Schlegel Avatar answered Nov 11 '22 17:11

Frank Schlegel