Adding "other linker flags" to a swift package

I've run into this issue: Xcode 15 beta 3 linker issue: ld: … | Apple Developer Forums (duplicate library warning) when upgrading to Xcode 15, with my project and a related Swift package i'm building. The warning can be turned off in Xcode by adding an "Other Linker Flags" setting

How do I do this in a swift package? Both so that users of my package don't have to add this setting to their project, and so that Xcode stops giving me this warning while i'm developing my package

Hello @simonmcl ,

nice having you on the forum :wave: and thank you for your question!

Try using the following code in Package.swift:

for target in package.targets {
  target.linkerSettings = target.linkerSettings ?? []
      "-Wl", "-no_duplicate_libraries"