Skip to content
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

Move backends behind target-specific features #11

Closed
fwcd opened this issue Apr 23, 2024 · 1 comment
Closed

Move backends behind target-specific features #11

fwcd opened this issue Apr 23, 2024 · 1 comment
Labels
on hold Blocked on something external

Comments

@fwcd
Copy link
Owner

fwcd commented Apr 23, 2024

This effectively depends on

...which would provide a clean way for users to choose their preferred backend, while minimizing friction for users that want nuit to "just work" with the standard backend for their platform (SwiftUI on macOS, GTK+ on Linux, ...).

Unfortunately, there isn't really a clean way to model this currently (April 2024), even in nightly Rust. Potential workarounds:

  • Introduce wrapper crates for the individual backends that use the existing target-specific dependencies mechanism.
    • Drawback: Introduces a lot of boilerplate and we need to publish those crates to crates.io too, so we'd have to settle for some naming scheme
  • Turn all backends into features, put the standard backend for every platform into the default features and make backends/features a no-op on unsupported platforms
    • This is effectively the approach taken by winit
    • Drawback: Potentially confusing, since enabling a backend feature would not necessarily imply building that backend (on unsupported platforms)
@fwcd fwcd added the on hold Blocked on something external label Apr 23, 2024
@fwcd
Copy link
Owner Author

fwcd commented Aug 25, 2024

We use the no-op approach for now.

@fwcd fwcd closed this as completed Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold Blocked on something external
Projects
None yet
Development

No branches or pull requests

1 participant