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

Make winapi optional. #280

Merged
merged 1 commit into from Aug 11, 2019
Merged

Make winapi optional. #280

merged 1 commit into from Aug 11, 2019

Conversation

@RazrFalcon
Copy link
Contributor

RazrFalcon commented Aug 10, 2019

Currently, the winapi crate is mandatory. But it's very big (100MB). This patch makes it optional by introducing the win32-surface feature.

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

GuillaumeGomez commented Aug 10, 2019

Big improvement indeed, thanks a lot!

cc @EPashkin @sdroege

@EPashkin

This comment has been minimized.

@RazrFalcon

This comment has been minimized.

Copy link
Contributor Author

RazrFalcon commented Aug 10, 2019

@EPashkin It has cfgs already. Not sure what it doesn't like. I've tested it on a local machine first.

Looks like winapi should be exported with dox on Windows too. Can you clarify that?

@RazrFalcon

This comment has been minimized.

Copy link
Contributor Author

RazrFalcon commented Aug 10, 2019

I've enabled winapi for dox too. Maybe this would help.

extern crate winapi as winapi_orig;

#[cfg(windows)]
#[cfg(all(windows, feature = "win32-surface"))]

This comment has been minimized.

Copy link
@EPashkin

EPashkin Aug 10, 2019

Member

IMHO also need to add "dox" here and to previous cfg

This comment has been minimized.

Copy link
@EPashkin

EPashkin Aug 10, 2019

Member

No, I was wrong, "dox" in Cargo.toml not needed "winapi" as it will fail on nonwindows.
And here needed separate module for it

#[cfg(feature = "dox")]
pub mod winapi {
    pub enum HDC__ {}
    pub type HDC = *mut HDC__;
}

This comment has been minimized.

Copy link
@EPashkin

EPashkin Aug 10, 2019

Member

Maybe with and and(.., not(all(windows, feature = "win32-surface")) but IMHO this unneeded as docs will be generated on unix anyway.

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Aug 10, 2019

@RazrFalcon Thanks, 👍

@sdroege

This comment has been minimized.

Copy link
Member

sdroege commented Aug 11, 2019

👍

@GuillaumeGomez GuillaumeGomez merged commit 9c50598 into gtk-rs:master Aug 11, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.