From 48fc3ec8fa25c0cb001603f025ab516e8f0df1e2 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 15 Apr 2025 10:18:42 +0200 Subject: [PATCH] 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 Signed-off-by: Paolo Bonzini --- docs/markdown/Reference-tables.md | 2 ++ mesonbuild/envconfig.py | 4 ++-- mesonbuild/environment.py | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/markdown/Reference-tables.md b/docs/markdown/Reference-tables.md index 1c5f9a33a..a5d27858e 100644 --- a/docs/markdown/Reference-tables.md +++ b/docs/markdown/Reference-tables.md @@ -208,6 +208,8 @@ Meson natively. | ios-simulator | | | tvos | Apple tvOS | | tvos-simulator | | +| visionos | Apple visionOS | +| visionos-simulator | | | watchos | Apple watchOS | | watchos-simulator | | diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py index c877a7c5a..43fad0cd2 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py @@ -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: """ diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index a0d98ae58..f322cda95 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -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',