Search code examples
iosxcodeios-simulatormetalmetalkit

Ignore .metal files when building for iOS Simulator target


Whenever I build a project that includes a metal shader to an x86_64 target (iOS simulator), I get a dependency analysis warning:

warning: no rule to process file '[File Path]/Shaders.metal' of type sourcecode.metal for architecture x86_64

I know this isn't a huge issue but I like to keep my projects free from warnings when I build, so that when a real issue does arise, I actually notice the yellow warning triangle.

Any quick way to get Xcode to ignore metal files for simulator targets?


Solution

  • As of Xcode 11, Simulator supports Metal when running on macOS Catalina. Metal files are supported during the build, including when running on macOS Mojave or when building with an older deployment target. Metal won't be functional in those scenarios but you no longer need to exclude files from the build. (Of course when running iOS 13 / tvOS 13 simulators on 10.15 Metal actually works).