Adding Metal Library target to framework throws duplicated output file error

Hi,

This is in Xcode 15.2 (15C500b), macOS Sonoma 14.2.1 on M1 Pro.

Steps:

  1. Create a new project of type Framework
  2. Add a new Metal Library target
  3. Select the schema for the newly created Metal Library target or add a dependency to the framework and select the framework schema
  4. Build

Throws:

Multiple commands produce '/Users/.../Library/Developer/Xcode/DerivedData/test_framework-ditkrfuwxcsuelfrvnlbjntbpvgq/Build/Products/Debug-iphoneos/mymetallib.metallib'

Target 'mymetallib' (project 'test_framework'): MetalLink /Users/.../Library/Developer/Xcode/DerivedData/test_framework-ditkrfuwxcsuelfrvnlbjntbpvgq/Build/Products/Debug-iphoneos/mymetallib.metallib

Target 'mymetallib' (project 'test_framework') has link command with output '/Users/.../Library/Developer/Xcode/DerivedData/test_framework-ditkrfuwxcsuelfrvnlbjntbpvgq/Build/Products/Debug-iphoneos/mymetallib.metallib'

Thanks

Well, I think I could found the culprit.

First, doing it the other way around works: create a new Metal Library project and then adding a new target of Framework type.

Looking at the differences of the "Build settings" between the metal library targets in both projects, this one:

Versioning -> Versioning System

was set to "Apple Generic" in the project that throws the error.

Changing it to "None" works.

Adding Metal Library target to framework throws duplicated output file error
 
 
Q