Rust-GPU / cargo-gpu

Command line tool for building Rust shaders using rust-gpu
MIT License
6 stars 1 forks source link

Use optional cargo-gpu.toml file #6

Open schell opened 2 days ago

schell commented 2 days ago

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 commented 2 days ago

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"
tombh commented 17 hours ago

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 commented 13 hours ago

Yep, we had previously discussed this in https://github.com/EmbarkStudios/rust-gpu/issues/1137#issuecomment-1973729786