@@ -600,25 +600,9 @@ impl<'a> Builder<'a> {
600600 //
601601 // FIXME: the guard against msvc shouldn't need to be here
602602 if !target. contains ( "msvc" ) {
603- let ccache = self . config . ccache . as_ref ( ) ;
604- let ccacheify = |s : & Path | {
605- let ccache = match ccache {
606- Some ( ref s) => s,
607- None => return s. display ( ) . to_string ( ) ,
608- } ;
609- // FIXME: the cc-rs crate only recognizes the literal strings
610- // `ccache` and `sccache` when doing caching compilations, so we
611- // mirror that here. It should probably be fixed upstream to
612- // accept a new env var or otherwise work with custom ccache
613- // vars.
614- match & ccache[ ..] {
615- "ccache" | "sccache" => format ! ( "{} {}" , ccache, s. display( ) ) ,
616- _ => s. display ( ) . to_string ( ) ,
617- }
618- } ;
619- let cc = ccacheify ( & self . cc ( target) ) ;
620- cargo. env ( format ! ( "CC_{}" , target) , & cc)
621- . env ( "CC" , & cc) ;
603+ let cc = self . cc ( target) ;
604+ cargo. env ( format ! ( "CC_{}" , target) , cc)
605+ . env ( "CC" , cc) ;
622606
623607 let cflags = self . cflags ( target) . join ( " " ) ;
624608 cargo. env ( format ! ( "CFLAGS_{}" , target) , cflags. clone ( ) )
@@ -633,9 +617,8 @@ impl<'a> Builder<'a> {
633617 }
634618
635619 if let Ok ( cxx) = self . cxx ( target) {
636- let cxx = ccacheify ( & cxx) ;
637- cargo. env ( format ! ( "CXX_{}" , target) , & cxx)
638- . env ( "CXX" , & cxx)
620+ cargo. env ( format ! ( "CXX_{}" , target) , cxx)
621+ . env ( "CXX" , cxx)
639622 . env ( format ! ( "CXXFLAGS_{}" , target) , cflags. clone ( ) )
640623 . env ( "CXXFLAGS" , cflags) ;
641624 }
0 commit comments