Skip to content

Target Specific Compilation #7076

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

Merged

Conversation

cwfitzgerald
Copy link
Member

@cwfitzgerald cwfitzgerald commented Feb 7, 2025

Further attempt target specific stuff

Closes #7064
Closes #6949
Closes #3514

@cwfitzgerald cwfitzgerald requested a review from a team as a code owner February 7, 2025 01:46
@cwfitzgerald cwfitzgerald marked this pull request as draft February 7, 2025 01:46
@cwfitzgerald cwfitzgerald marked this pull request as ready for review February 9, 2025 22:19
Copy link
Contributor

@nical nical left a comment

Choose a reason for hiding this comment

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

Nice! It looks worthy of a changelog entry.

@Wumpf Wumpf self-requested a review February 10, 2025 19:51
@cwfitzgerald
Copy link
Member Author

Changelog added

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

wow. that's it. I think you really figured it out! <3

Apart from the mostly doc oriented comments I left, there's some code here that you need to patch up now as part of this change

@cwfitzgerald cwfitzgerald requested a review from Wumpf February 18, 2025 22:52
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

awesome. very happy about this now. shipping time!

Comment on lines +147 to +157
# The target limitation here isn't needed, but prevents more than one of these
# platform crates from being included in the build at a time, preventing users
# from getting confused by seeing them in the list of crates.
[target.'cfg(target_vendor = "apple")'.dependencies]
wgpu-core-deps-apple = { workspace = true, optional = true }
[target.'cfg(target_os = "emscripten")'.dependencies]
wgpu-core-deps-emscripten = { workspace = true, optional = true }
[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies]
wgpu-core-deps-wasm = { workspace = true, optional = true }
[target.'cfg(any(windows, target_os = "linux", target_os = "android"))'.dependencies]
wgpu-core-deps-windows-linux-android = { workspace = true, optional = true }
Copy link
Member

Choose a reason for hiding this comment

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

clever! it's technically also a lil bit faster because then there's a smaller number of crates that cargo has to dispatch and makes the --timings report better

@Wumpf Wumpf merged commit ae5dc0e into gfx-rs:trunk Feb 22, 2025
34 checks passed
@Wumpf
Copy link
Member

Wumpf commented Feb 22, 2025

Apart from the mostly doc oriented comments I left, there's some code here that you need to patch up now as part of this change

ah shoot. I forgot again about that piece. I'll do a follow-up!

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.

Add a default feature for wgpu that enables Vulkan & GLES on Windows & Linux
4 participants