1+ //! Args for building and installing. Previously in `spirv-tools-cli` but got moved here.
2+
3+ use spirv_builder:: SpirvBuilder ;
4+
5+ /// All args for a build and install
16#[ derive( clap:: Parser , Debug , Clone , serde:: Deserialize , serde:: Serialize ) ]
27pub struct AllArgs {
8+ /// build args
39 #[ clap( flatten) ]
410 pub build : BuildArgs ,
511
12+ /// install args
613 #[ clap( flatten) ]
714 pub install : InstallArgs ,
815}
916
17+ /// Args for just a build
1018#[ derive( clap:: Parser , Debug , Clone , serde:: Deserialize , serde:: Serialize ) ]
1119pub struct BuildArgs {
1220 /// Path to the output directory for the compiled shaders.
@@ -17,24 +25,31 @@ pub struct BuildArgs {
1725 #[ clap( long, short, action) ]
1826 pub watch : bool ,
1927
28+ /// the flattened [`SpirvBuilder`]
2029 #[ clap( flatten) ]
2130 #[ serde( flatten) ]
22- pub spirv_builder : spirv_builder :: SpirvBuilder ,
31+ pub spirv_builder : SpirvBuilder ,
2332
2433 ///Renames the manifest.json file to the given name
2534 #[ clap( long, short, default_value = "manifest.json" ) ]
2635 pub manifest_file : String ,
2736}
2837
38+ /// Args for an install
2939#[ derive( clap:: Parser , Debug , Clone , serde:: Deserialize , serde:: Serialize ) ]
3040pub struct InstallArgs {
41+ /// path to the `rustc_codegen_spirv` dylib
3142 #[ clap( long, hide( true ) , default_value = "INTERNALLY_SET" ) ]
3243 pub dylib_path : std:: path:: PathBuf ,
3344
3445 /// Directory containing the shader crate to compile.
3546 #[ clap( long, default_value = "./" ) ]
3647 pub shader_crate : std:: path:: PathBuf ,
3748
49+ #[ expect(
50+ clippy:: doc_markdown,
51+ reason = "The URL should appear literally like this. But Clippy wants it to be a in markdown clickable link"
52+ ) ]
3853 /// Source of `spirv-builder` dependency
3954 /// Eg: "https://github.com/Rust-GPU/rust-gpu"
4055 #[ clap( long) ]
@@ -81,8 +96,8 @@ pub struct InstallArgs {
8196 ///
8297 /// This hack is possible because the change from v3 to v4 only involves a minor change to the
8398 /// way source URLs are encoded. See these PRs for more details:
84- /// * https://github.com/rust-lang/cargo/pull/12280
85- /// * https://github.com/rust-lang/cargo/pull/14595
99+ /// * < https://github.com/rust-lang/cargo/pull/12280>
100+ /// * < https://github.com/rust-lang/cargo/pull/14595>
86101 #[ clap( long, action, verbatim_doc_comment) ]
87102 pub force_overwrite_lockfiles_v4_to_v3 : bool ,
88103}
0 commit comments