How to set Swift version 5 (for recent dev snapshots) in Xcode build settings?

I thought of two ways to get around this limitation but they don't work because of build system issues:

  • Adding -swift-version 5 in OTHER_SWIFT_FLAG doesn't work because these flags are added before the build system adds the evaluated value of SWIFT_VERSION.
  • Overriding SWIFT_VERSION using an xcconfig doesn't work because the build system validates the value against the hardcoded list.