-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add no_std
support to bevy_input
#16995
Conversation
Also fixed some minor issues with `bevy_math` and `bevy_ecs`
no_std
support to `bevy_inputno_std
support to bevy_input
#[cfg(feature = "bevy_reflect")] | ||
use bevy_reflect::Reflect; | ||
|
||
#[cfg(not(feature = "smol_str"))] | ||
use alloc::string::String as SmolStr; |
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.
Cursed
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.
Just avoids further changing code without reason, but I do agree this isn't pretty haha. I'm hoping the PR I've made upstream will be worked-on/accepted so we can just remove this feature gate entirely.
"serialize", | ||
] } | ||
bevy_math = { path = "../bevy_math", version = "0.15.0-dev", default-features = false, features = [ | ||
"rand", |
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.
Seems that the bevy_math/rand
feature just disappeared during these changes.
Is that intentional? (I mean I don't see a reason for bevy_input to need random numbers.)
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.
Yeah I deliberately left that feature off since I couldn't see anything in bevy_input
that actually needed it.
# Objective - Contributes to bevyengine#15460 ## Solution - Added the following features: - `std` (default) - `smol_str` (default) - `portable-atomic` - `critical-section` - `libm` - Fixed an existing issue where `bevy_reflect` wasn't properly feature gated. ## Testing - CI ## Notes - There were some minor issues with `bevy_math` and `bevy_ecs` noticed in this PR which I have also resolved here. I can split these out if desired, but I've left them here for now as they're very small changes and I don't consider this PR itself to be very controversial. - `libm`, `portable-atomic`, and `critical-section` are shortcuts to enable the relevant features in dependencies, making the usage of this crate on atomically challenged platforms possible and simpler. - `smol_str` is gated as it doesn't support atomically challenged platforms (e.g., Raspberry Pi Pico). I have an issue and a [PR](rust-analyzer/smol_str#91) to discuss this upstream.
Objective
no_std
Bevy #15460Solution
std
(default)smol_str
(default)portable-atomic
critical-section
libm
bevy_reflect
wasn't properly feature gated.Testing
Notes
bevy_math
andbevy_ecs
noticed in this PR which I have also resolved here. I can split these out if desired, but I've left them here for now as they're very small changes and I don't consider this PR itself to be very controversial.libm
,portable-atomic
, andcritical-section
are shortcuts to enable the relevant features in dependencies, making the usage of this crate on atomically challenged platforms possible and simpler.smol_str
is gated as it doesn't support atomically challenged platforms (e.g., Raspberry Pi Pico). I have an issue and a PR to discuss this upstream.