-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change logic to disable OpenXR for iOS #781
Conversation
Tested on [Host] [Target] |
Thanks a lot! Maybe someone with macOS can help review this, e.g. @Ughuuu? |
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_else(|_| "unknown".to_string()); | ||
if godot_ty.starts_with("OpenXR") { | ||
return true; | ||
if target_os == "ios" { | ||
return true; | ||
} | ||
if target_os == "macos" { | ||
#[cfg(before_api = "4.2")] | ||
return true; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the let
could be moved inside if
.
Also, you might want to use match
against Some("ios")
, Some("macos")
and None
-- then you wouldn't need the "unknown" case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated with match statement
Due to `target_os = ios` not working when cross-platform building, use `CARGO_CFG_TARGET_OS` to check the target OS instead.
@Bromeon there isn't much code I am familiar with here, looks good to me tho. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
Due to
target_os = ios
not working when cross-platform building,use
CARGO_CFG_TARGET_OS
to check the target OS instead.