Below copied from my original post here: https://forums.swift.org/t/xcode-16-2-beta-seems-increase-the-min-deploy-to-16-0-for-swift-cpp-mixed-project/76221
Our games are set to min deploy of iOS 12.0. When building with the Xcode 16.2 beta3, the Xcode 16.1 build-able project will have errors for those static libs that has swift mixed with C++:
Compiling for iOS 12.0, but module 'Cxx' has a minimum deployment target of iOS 16.0: /Users/trout.zhang/Documents/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Cxx.swiftmodule/arm64-apple-ios.swiftmodule
Change that static lib min deploy to 16.0 can make the build succeed, while maintain the exe target still use iOS 12.0.
I am not familiar with how the min deploy works, is it:
- choosing the highest of exe and its dependencies, thus effectively set the final product has min deploy of iOS 16.0
- or maintaining exe's iOS 12.0 and actually crash in runtime if the iOS is less than 16.0, when reach the code in that static lib.
Apparently, non of the above is what we want.
Use cat in cmdline, for
Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Cxx.swiftmodule/arm64-apple-ios.swiftdoc
with both Xcode.app(16.1) and Xcode-beta.app(16.2 beta3), I found the different lines:
Xcode 16.1 has:
Apple Swift version 6.0.2 effective-5.10 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)Cxx?arm64-apple-ios11.0
Xcode 16.2 beta 3 has:
Apple Swift version 6.0.3 effective-5.10 (swiftlang-6.0.3.1.8 clang-1600.0.30.1)Cxx?arm64-apple-ios16.0