Open source toolchains don't recognize visionOS?

Is there a reason why the open source toolchains from don't recognize visionOS as a proper os conditional? Using the latest main toolchain (March 1) it doesn't recognize visionOS or the older xrOS. Can this be enabled or the platform ported from Apple's version of the compiler?


visionOS support was only merged into upstream LLVM fairly recently, in January (#77707, #78373, #78392, #78389, possibly others). It looks like those patches made it into the 20240123 rebranch on apple/llvm-project, as well (I just spot-checked the target triple changes, not all the others).

However, the only change that's been upstreamed to apple/swift is this one, to silence a switch exhaustiveness warning.

Now that the underlying LLVM changes appear to be in place, is there a timeline for Apple upstreaming the remaining Swift changes for visionOS that they're building into Xcode's toolchains?

1 Like

This is being actively worked on, and we hope to have a patch up fairly soon.


Didn't realize this required support down in LLVM. I look forward to toolchain support.