File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -207,10 +207,12 @@ fn build() -> io::Result<()> {
207207 let cc = cc:: Build :: new ( ) ;
208208 let compiler = cc. get_compiler ( ) ;
209209 let compiler = compiler. path ( ) . file_stem ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
210- let suffix_pos = compiler. rfind ( '-' ) . unwrap ( ) ; // cut off "-gcc"
211- let prefix = compiler[ 0 ..suffix_pos] . trim_end_matches ( "-wr" ) ; // "wr-c++" compiler
210+ if let Some ( suffix_pos) = compiler. rfind ( '-' ) {
211+ // cut off "-gcc"
212+ let prefix = compiler[ 0 ..suffix_pos] . trim_end_matches ( "-wr" ) ; // "wr-c++" compiler
213+ configure. arg ( format ! ( "--cross-prefix={}-" , prefix) ) ;
214+ }
212215
213- configure. arg ( format ! ( "--cross-prefix={}-" , prefix) ) ;
214216 configure. arg ( format ! (
215217 "--arch={}" ,
216218 env:: var( "CARGO_CFG_TARGET_ARCH" ) . unwrap( )
You can’t perform that action at this time.
0 commit comments