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

Allow downstream libraries' documentation to work without feature flags #117

Open
madsmtm opened this issue Sep 1, 2023 · 1 comment
Open

Comments

@madsmtm
Copy link
Member

madsmtm commented Sep 1, 2023

Running cargo doc --target=aarch64-linux-android in winit fails to build because we haven't selected an activity.

It would be nice if that wasn't the case, e.g. the library compiled in #[cfg(doc)] successfully without selecting an activity.

(I think this is also why currently, winit doesn't display any platform-specific documentation for Android on docs.rs).

@MarijnS95
Copy link
Member

There is already a --cfg docsrs to steer some of this when we build this maybe it might help:

https://github.com/rust-mobile/android-activity/blob/main/android-activity/Cargo.toml#L62C27-L62C33


However:

Running cargo doc --target=aarch64-linux-android in winit fails to build because we haven't selected an activity.

That is strange though because there's already a && not(doc) there, to not panic if no activity is selected (but I guess it doesn't compile thereafter regardless, and we need to select a default?):

#[cfg(all(
not(any(feature = "game-activity", feature = "native-activity")),
not(doc)
))]
compile_error!(
r#"Either "game-activity" or "native-activity" must be enabled as features

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

No branches or pull requests

2 participants