Skip to content

Commit 4dc2720

Browse files
authored
Merge pull request #781 from jeyum2/fix-openxr-ios
Change logic to disable OpenXR for iOS
2 parents 02c11b5 + 18fce3c commit 4dc2720

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

godot-codegen/src/special_cases/special_cases.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,16 @@ pub fn is_godot_type_deleted(godot_ty: &str) -> bool {
8888
// See e.g. https://github.com/GodotVR/godot-xr-tools/issues/479.
8989
// OpenXR is also not available on iOS: https://github.com/godotengine/godot/blob/13ba673c42951fd7cfa6fd8a7f25ede7e9ad92bb/modules/openxr/config.py#L2
9090
// Do not hardcode a list of OpenXR classes, as more may be added in future Godot versions; instead use prefix.
91-
#[cfg(any(all(before_api = "4.2", target_os = "macos"), target_os = "ios"))]
9291
if godot_ty.starts_with("OpenXR") {
93-
return true;
92+
let target_os = std::env::var("CARGO_CFG_TARGET_OS");
93+
match target_os.as_deref() {
94+
Ok("ios") => return true,
95+
Ok("macos") => {
96+
#[cfg(before_api = "4.2")]
97+
return true;
98+
}
99+
_ => {}
100+
}
94101
}
95102

96103
// ThemeDB was previously loaded lazily

0 commit comments

Comments
 (0)