How do I add a plugin's output to the linker's inputs?

From the examples I've seen, it seems that if a build tool plugin produces .swift files, those are automatically compiled and added to the project. But what if I want to produce a different type of file that would be used by the linker directly?

For the record, I tried running swift build --verbose, taking the linker command line, manually adding the produced file, and running the modified line. The result is what I want, but I want the process to be automatic (Otherwise there's no point in using SwiftPM).

I want to know how I can tell SwiftPM to add the generated file(s) to the linker's inputs. If possible, from within the plugin itself.