@@ -6,7 +6,7 @@ use crate::spirv_source::{
66use  crate :: target_specs:: update_target_specs_files; 
77use  crate :: { cache_dir,  spirv_source:: SpirvSource } ; 
88use  anyhow:: Context  as  _; 
9- use  spirv_builder:: SpirvBuilder ; 
9+ use  spirv_builder:: { IntoSpirvTarget ,   SpirvBuilder } ; 
1010use  std:: path:: { Path ,  PathBuf } ; 
1111
1212/// Represents a functional backend installation, whether it was cached or just installed. 
@@ -32,7 +32,7 @@ impl InstalledBackend {
3232    pub  fn  to_spirv_builder ( 
3333        & self , 
3434        path_to_crate :  impl  AsRef < Path > , 
35-         target :  impl  Into < String > , 
35+         target :  impl  IntoSpirvTarget , 
3636    )  -> SpirvBuilder  { 
3737        let  mut  builder = SpirvBuilder :: new ( path_to_crate,  target) ; 
3838        self . configure_spirv_builder ( & mut  builder) 
@@ -48,10 +48,12 @@ impl InstalledBackend {
4848    pub  fn  configure_spirv_builder ( & self ,  builder :  & mut  SpirvBuilder )  -> anyhow:: Result < ( ) >  { 
4949        builder. rustc_codegen_spirv_location  = Some ( self . rustc_codegen_spirv_location . clone ( ) ) ; 
5050        builder. toolchain_overwrite  = Some ( self . toolchain_channel . clone ( ) ) ; 
51-         builder. path_to_target_spec  = Some ( self . target_spec_dir . join ( format ! ( 
52-             "{}.json" , 
53-             builder. target. as_ref( ) . context( "expect target to be set" ) ?
54-         ) ) ) ; 
51+         let  file_name = builder
52+             . target 
53+             . clone ( ) 
54+             . context ( "expect target to be set" ) ??
55+             . target_json_file_name ( ) ; 
56+         builder. path_to_target_spec  = Some ( self . target_spec_dir . join ( file_name) ) ; 
5557        Ok ( ( ) ) 
5658    } 
5759} 
0 commit comments