Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

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

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

@GuillaumeGomez
Copy link
Member

Big improvement indeed, thanks a lot!

cc @EPashkin @sdroege

@EPashkin
Copy link
Member

@RazrFalcon
Copy link
Contributor Author

@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
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"))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

@EPashkin EPashkin Aug 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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__;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@EPashkin
Copy link
Member

@RazrFalcon Thanks, 👍

@sdroege
Copy link
Member

sdroege commented Aug 11, 2019

👍

@GuillaumeGomez GuillaumeGomez merged commit 9c50598 into gtk-rs:master Aug 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants