File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,14 @@ fn build(target_os: &str) -> io::Result<()> {
209209        // The cc crate has the messy logic of guessing a working prefix, 
210210        // and this is a messy way of reusing that logic. 
211211        let  cc = cc:: Build :: new ( ) ; 
212+ 
213+         // Apple-clang needs this, -arch is not enough. 
214+         let  target_flag = format ! ( "--target={}" ,  target) ; 
215+         if  cc. is_flag_supported ( & target_flag) . unwrap_or ( false )  { 
216+             configure. arg ( format ! ( "--extra-cflags={}" ,  target_flag) ) ; 
217+             configure. arg ( format ! ( "--extra-ldflags={}" ,  target_flag) ) ; 
218+         } 
219+ 
212220        let  compiler = cc. get_compiler ( ) ; 
213221        let  compiler = compiler. path ( ) . file_stem ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ; 
214222        if  let  Some ( suffix_pos)  = compiler. rfind ( '-' )  { 
@@ -340,6 +348,8 @@ fn build(target_os: &str) -> io::Result<()> {
340348    // configure misc build options 
341349    enable ! ( configure,  "BUILD_PIC" ,  "pic" ) ; 
342350
351+     println ! ( "configure cmd: {:?}" ,  configure) ; 
352+ 
343353    // run ./configure 
344354    let  output = configure
345355        . output ( ) 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments