environment: handle all iOS variants as xnu

All of iOS, tvOS, visionOS, watchOS use the XNU kernel.  Report that and also
make them return true for is_darwin() which is really more like "is_xnu()".

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2025-04-15 10:18:42 +02:00 committed by Jussi Pakkanen
parent 59d3c427f5
commit 48fc3ec8fa
3 changed files with 8 additions and 2 deletions

View File

@ -208,6 +208,8 @@ Meson natively.
| ios-simulator | |
| tvos | Apple tvOS |
| tvos-simulator | |
| visionos | Apple visionOS |
| visionos-simulator | |
| watchos | Apple watchOS |
| watchos-simulator | |

View File

@ -320,9 +320,9 @@ class MachineInfo(HoldableObject):
def is_darwin(self) -> bool:
"""
Machine is Darwin (iOS/tvOS/OS X)?
Machine is Darwin (macOS/iOS/tvOS/visionOS/watchOS)?
"""
return self.system in {'darwin', 'ios', 'tvos'}
return self.system in {'darwin', 'ios', 'tvos', 'visionos', 'watchos'}
def is_android(self) -> bool:
"""

View File

@ -487,6 +487,10 @@ KERNEL_MAPPINGS: T.Mapping[str, str] = {'freebsd': 'freebsd',
'linux': 'linux',
'cygwin': 'nt',
'darwin': 'xnu',
'ios': 'xnu',
'tvos': 'xnu',
'visionos': 'xnu',
'watchos': 'xnu',
'dragonfly': 'dragonfly',
'haiku': 'haiku',
'gnu': 'gnu',