title: Swift Version Conflict: this SDK is not supported by the compiler - using BUILD_LIBRARY_FOR_DISTRIBUTION setting. What could be the issue?
body: <p>I'm building a Swift static library with:</p>
  <ul>
  <li>Xcode 13.2 (Swift compiler 5.5.2)</li>
  <li>iOS Deployment target 12.0</li>
  <li>Build library for distribution <strong>YES</strong></li>
  <li>Skip install <strong>NO</strong></li>
  <li>Swift language version 5 and tried with 4.2
  Dependency managed with CocoaPods:</li>
  <li>Japx 3.0.0</li>
  <li>Alamofire 5.2.2</li>
  <li>RxSwift</li>
  </ul>
  <p>When I try to add it to an iOS project with this setup:</p>
  <ul>
  <li>Xcode 13.3 (Swift compiler 5.6)</li>
  <li>iOS Deployment target 12.0</li>
  <li>Swift language version 5 and tried with 4.2
  and build I get this error:</li>
  </ul>
  <pre><code>Failed to build module 'LibraryX'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.5.2 effective-4.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)', while this compiler is 'Apple Swift version 5.6 effective-4.2 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)'). Please select a toolchain which matches the SDK.
  </code></pre>
  <p>These are the headers in the .swiftinterface</p>
  <pre><code>// swift-interface-format-version: 1.0
  // swift-compiler-version: Apple Swift version 5.5.2 effective-4.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)
  // swift-module-flags: -target arm64-apple-ios12.0 -enable-objc-interop -enable-library-evolution -swift-version 4.2 -enforce-exclusivity=checked -Onone -module-name LibraryX
  </code></pre>
  <p>Obviously if I build the project with the same compiler version or building the library with the iOS project everything works fine. But the purpose here is to release a precompiled library and not its source code.</p>
  <p>Every time that I lookup this error online I've found &quot;You have to set Build library for distribution to Yes&quot;</p>
  <p>I tried to add the source code of the static library to a new Framework project, but I get the same result.</p>