Home metallib
Post
Cancel

metallib

Building a Library with Metal’s Command-Line Tools

  1. Use the metal tool to compile each .metal file into a single .air file, which stores an intermediate representation of Metal Shading Language source code.
  2. Optionally, use the metal-ar tool to archive several .air files together into a single .metalar file. (The metal-ar tool is similar to the UNIX ar tool.)
  3. Use the metallib tool to build .air or .metalar files into a single .metallib file, which stores the Metal library.
1
2
xcrun -sdk macosx metal -c MyLibrary.metal -o MyLibrary.air
xcrun -sdk macosx metallib MyLibrary.air -o MyLibrary.metallib
This post is licensed under CC BY 4.0 by the author.