I'm working on an app that includes some Metal code, when building for the simulator we stub out the parts that need Metal using #if targetEnvironment(simulator), which works fine by itself
However, the simulator build still fails on trying to compile the .metal file itself, as there is no metal compiler for the simulator. Since there is no need to compile the Metal file for the simulator, I would like to remove the .metal file from the build in case we're building for the simulator, so we can test the rest of the app on the simulator using stubs for our metal code.
Is there a way to exclude metal files from the build when building for a simulator ?