@@ -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:: env;
1111use std:: path:: { Path , PathBuf } ;
1212
@@ -33,7 +33,7 @@ impl InstalledBackend {
3333 pub fn to_spirv_builder (
3434 & self ,
3535 path_to_crate : impl AsRef < Path > ,
36- target : impl Into < String > ,
36+ target : impl IntoSpirvTarget ,
3737 ) -> SpirvBuilder {
3838 let mut builder = SpirvBuilder :: new ( path_to_crate, target) ;
3939 self . configure_spirv_builder ( & mut builder)
@@ -49,10 +49,12 @@ impl InstalledBackend {
4949 pub fn configure_spirv_builder ( & self , builder : & mut SpirvBuilder ) -> anyhow:: Result < ( ) > {
5050 builder. rustc_codegen_spirv_location = Some ( self . rustc_codegen_spirv_location . clone ( ) ) ;
5151 builder. toolchain_overwrite = Some ( self . toolchain_channel . clone ( ) ) ;
52- builder. path_to_target_spec = Some ( self . target_spec_dir . join ( format ! (
53- "{}.json" ,
54- builder. target. as_ref( ) . context( "expect target to be set" ) ?
55- ) ) ) ;
52+ let file_name = builder
53+ . target
54+ . clone ( )
55+ . context ( "expect target to be set" ) ??
56+ . target_json_file_name ( ) ;
57+ builder. path_to_target_spec = Some ( self . target_spec_dir . join ( file_name) ) ;
5658 Ok ( ( ) )
5759 }
5860}
0 commit comments