Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
167 views
in Technique[技术] by (71.8m points)

macos - xcode product packaging Metallink

I have an xcode project which generates *.metal shaders using a custom build rule. Somehow xcode tried to automatically compile these generated shaders during the "Process product packaging" build step.
This fails, as these shaders are not meant to be compiled at that point. Is there a way to exclude the build rule outputs from building? If i remove the build rule inputs files from the "Copy Bundle Resources" list, the rule does not get called.
Adding the metal extension to the "Excluded Source File Names" also doesnt help.

question from:https://stackoverflow.com/questions/65887582/xcode-product-packaging-metallink

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I kinda have a solution for you, but it's not perfect.

Open your project in Xcode. Select the .metal file that's giving you trouble. If you go into File Inspector (View -> Inspectors -> File). There you can either uncheck all the targets under Target Membership so that Xcode doesn't try to build it at all. Or you can also try and change it's Type to like a text file or something.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...