File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -981,12 +981,17 @@ fn invoke_rustc(builder: &SpirvBuilder) -> Result<PathBuf, SpirvBuilderError> {
981
981
// target_spec jsons, some later version requires them, some earlier
982
982
// version fails with them (notably our 0.9.0 release)
983
983
if toolchain_rustc_version >= Version :: new ( 1 , 76 , 0 ) {
984
- let path = builder. path_to_target_spec . clone ( ) ;
985
- let path = if cfg ! ( feature = "include_target_specs" ) {
986
- path. unwrap_or_else ( || PathBuf :: from ( format ! ( "{TARGET_SPEC_DIR_PATH}/{target}.json" ) ) )
987
- } else {
988
- path. ok_or ( SpirvBuilderError :: MissingTargetSpec ) ?
989
- } ;
984
+ let path_opt = builder. path_to_target_spec . clone ( ) ;
985
+ let path;
986
+ #[ cfg( feature = "include_target_specs" ) ]
987
+ {
988
+ path = path_opt
989
+ . unwrap_or_else ( || PathBuf :: from ( format ! ( "{TARGET_SPEC_DIR_PATH}/{target}.json" ) ) ) ;
990
+ }
991
+ #[ cfg( not( feature = "include_target_specs" ) ) ]
992
+ {
993
+ path = path_opt. ok_or ( SpirvBuilderError :: MissingTargetSpec ) ?;
994
+ }
990
995
cargo. arg ( "--target" ) . arg ( path) ;
991
996
} else {
992
997
cargo. arg ( "--target" ) . arg ( target) ;
You can’t perform that action at this time.
0 commit comments