Skip to content

Commit 312f393

Browse files
committed
Exclude OpenXR classes for macOS on Godot < 4.2
1 parent 128cfce commit 312f393

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

godot-codegen/src/special_cases.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,32 @@ pub(crate) fn is_deleted(class_name: &TyName, godot_method_name: &str) -> bool {
3838

3939
#[rustfmt::skip]
4040
pub(crate) fn is_class_deleted(class_name: &TyName) -> bool {
41+
let class_name = class_name.godot_ty.as_str();
42+
4143
// TODO feature-gate experimental classes.
4244
/*
4345
if !cfg!(feature = "experimental-godot-api") && is_class_experimental(class_name) {
4446
return true;
4547
}
4648
*/
4749

48-
match class_name.godot_ty.as_str() {
50+
// OpenXR has not been available for macOS before 4.2.
51+
// See e.g. https://github.com/GodotVR/godot-xr-tools/issues/479.
52+
#[cfg(all(before_api = "4.2", target_os = "macos"))]
53+
match class_name {
54+
| "OpenXRHand"
55+
| "OpenXRAction"
56+
| "OpenXRActionMap"
57+
| "OpenXRActionSet"
58+
| "OpenXRInteractionProfile"
59+
| "OpenXRIPBinding"
60+
| "OpenXRInterface"
61+
62+
=> return true,
63+
_ => {}
64+
}
65+
66+
match class_name {
4967
// Hardcoded cases that are not accessible.
5068
| "JavaClassWrapper" // only on Android.
5169
| "JavaScriptBridge" // only on WASM.

0 commit comments

Comments
 (0)