I have an iOS framework using Metal; it sets up a pipeline descriptor as follows:
... _metalVars.mtlLibrary = [_metalVars.mtlDevice newLibraryWithFile:library