rust-mobile / ndk

Rust bindings to the Android NDK
Apache License 2.0
1.11k stars 110 forks source link

Suggestion: feature gate the code #429

Closed JohnScience closed 12 months ago

JohnScience commented 12 months ago

I believe it would be useful to provide features for different NDK versions. E.g. "r1", "r2", and so on.

For reference we can use https://developer.android.com/ndk/downloads/revision_history.

This will cut down compile times and most likely will result in fewer errors related to usage of newer versions of NDK than intended.

In order to keep the semver API compatibility, you can add "r24" to the default features.

MarijnS95 commented 12 months ago

Can you quantify those compile times and justify the need for additional development effort and maintenance?

Using NDK release numbers has no meaning as Android features are gated behind Android yearly releases, denoted by API levels instead.

Have you used these crates, and noticed that the ndk crate is already guarded by API levels and features when it requires an additional link library?

If such guards are missing in places, PRs are always welcome.