Skip to content

Make euclid build without libm #543

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

nical
Copy link
Contributor

@nical nical commented Apr 18, 2025

Currently euclid can build in a no-std environment only if the libm feature is enabled. As a result, downstream crates that want to support no-std have to either add a libm feature or force the libm dependency even in the default std configuration.
There are users of euclid that don't need the float math functionality that is provided by std/libm, For example etagere and guillotiere that mostly use the types in their public API and some simple rectangle functionality that doesn't require libm.

This PR aims to address that by sprinkling #[cfg(any(feature = "std", feature = "libm"))] until euclid builds with --no-default-features.
It isn't super pretty, but it's simple to review and can be easily followed up with a patch that consolidates all of these #[cfg] into a single per type in front of an impl block for all of the functions that need libm/std.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant