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

Automatically assume that win32_ and unix_ should use the related cfg #1540

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

GuillaumeGomez
Copy link
Member

You can take a look at the result here (I didn't remove all unneeded cfg_condition yet).

src/update_cfgs.rs Outdated Show resolved Hide resolved
None => Some("windows".to_string()),
Some(cfg) => Some(format!("{cfg},windows")),
}
} else if sub_object_name.starts_with("Unix") {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe also UNIX (all-uppercase)?

@sdroege
Copy link
Member

sdroege commented Jan 29, 2024

Generated code seems fine to me

@sdroege
Copy link
Member

sdroege commented Jan 29, 2024

@GuillaumeGomez Are the are Windows/UNIX cfgs left in gtk-rs-core Gir.tomls after this?

@GuillaumeGomez
Copy link
Member Author

Yes. I only did it for gio iirc.

src/update_cfgs.rs Outdated Show resolved Hide resolved
@GuillaumeGomez
Copy link
Member Author

Updated: it now takes into account the namespace the type comes from. Nothing to do for constants: their (non-c) name doesn't have a prefix apparently.

@GuillaumeGomez GuillaumeGomez merged commit 5975266 into gtk-rs:master Feb 5, 2024
7 checks passed
@GuillaumeGomez GuillaumeGomez deleted the gen-cfg-automatically branch February 5, 2024 14:33
@GuillaumeGomez
Copy link
Member Author

I'll send PRs to other projects next.

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

Successfully merging this pull request may close these issues.

3 participants