Skip to content

Target Specific Compilation#7076

Merged
Wumpf merged 16 commits intogfx-rs:trunkfrom
cwfitzgerald:cw/proper-target-conditional-compilation
Feb 22, 2025
Merged

Target Specific Compilation#7076
Wumpf merged 16 commits intogfx-rs:trunkfrom
cwfitzgerald:cw/proper-target-conditional-compilation

Conversation

@cwfitzgerald
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

Changelog added

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@Wumpf
Copy link
Copy Markdown
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