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

Use optional [package.metadata.rust-gpu] in Cargo.toml #6

Closed
schell opened this issue Nov 10, 2024 · 4 comments · Fixed by #16
Closed

Use optional [package.metadata.rust-gpu] in Cargo.toml #6

schell opened this issue Nov 10, 2024 · 4 comments · Fixed by #16
Assignees
Labels
enhancement New feature or request

Comments

@schell
Copy link
Collaborator

schell commented Nov 10, 2024

To make it easier for projects to use cargo-gpu and since there are a good number of options to remember, maybe we should allow the use of an option cargo-gpu.toml file?

Something like this:

[build]
shader-crate = "crates/renderling"
output-dir = "crates/renderling/shaders"
shader-manifest = "crates/renderling/shaders/manifest.json"
@schell
Copy link
Collaborator Author

schell commented Nov 10, 2024

Nope! It's actually easy to set this up by hand with a cargo alias in .cargo/config.toml:

[alias]
shaders = "gpu build --output-dir crates/renderling/shaders --shader-crate crates/renderling/ --shader-manifest crates/renderling/shaders/manifest.json"

@schell schell closed this as completed Nov 10, 2024
@tombh
Copy link

tombh commented Nov 12, 2024

I don't think .cargo/config.toml can be relied on to be committed to a project? For example I keep some project-specific, personal preferences in there.

What about a [package.metadata.rust-gpu] section in Cargo.toml? The pacakge.metadata namespace is ignored by cargo, so it's safe to use.

@LegNeato
Copy link

Yep, we had previously discussed this in EmbarkStudios/rust-gpu#1137 (comment)

@LegNeato LegNeato reopened this Nov 12, 2024
@schell
Copy link
Collaborator Author

schell commented Nov 13, 2024

Ok, I'll work on this.

@schell schell self-assigned this Nov 13, 2024
@schell schell added the enhancement New feature or request label Nov 13, 2024
@schell schell changed the title Use optional cargo-gpu.toml file Use optional [package.metadata.rust-gpu] in Cargo.toml Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants