Ignore unrecognized platform name warnings

Is there any way to ignore the following warnings from swift build?

warning: unrecognized platform name 'visionOS'

e.g., can I:

  • add visionOS to a list of platforms to ignore?
  • add unrecognized platform name 'visionOS' to a list of warning messages to ignore?

Or must I enclose every @available(… visionOS …) in its own if #available(swift …) {@available(… visionOS …)} else {@available(… …)} block? Or something else?

Try using -Xswiftc -suppress-warnings when running swift build, though it’s a bit of a blunt tool. Another option is wrapping @available(visionOS, *) in #if os(visionOS), but yeah, it can get messy.