@@ -119,7 +119,7 @@ pub struct Build {
119
119
lldb_python_dir : Option < String > ,
120
120
121
121
// Runtime state filled in later on
122
- cc : HashMap < String , ( gcc:: Tool , PathBuf ) > ,
122
+ cc : HashMap < String , ( gcc:: Tool , Option < PathBuf > ) > ,
123
123
cxx : HashMap < String , gcc:: Tool > ,
124
124
compiler_rt_built : RefCell < HashMap < String , PathBuf > > ,
125
125
}
@@ -549,7 +549,7 @@ impl Build {
549
549
// FIXME: the guard against msvc shouldn't need to be here
550
550
if !target. contains ( "msvc" ) {
551
551
cargo. env ( format ! ( "CC_{}" , target) , self . cc ( target) )
552
- . env ( format ! ( "AR_{}" , target) , self . ar ( target) )
552
+ . env ( format ! ( "AR_{}" , target) , self . ar ( target) . unwrap ( ) ) // only msvc is None
553
553
. env ( format ! ( "CFLAGS_{}" , target) , self . cflags ( target) . join ( " " ) ) ;
554
554
}
555
555
@@ -825,8 +825,8 @@ impl Build {
825
825
}
826
826
827
827
/// Returns the path to the `ar` archive utility for the target specified.
828
- fn ar ( & self , target : & str ) -> & Path {
829
- & self . cc [ target] . 1
828
+ fn ar ( & self , target : & str ) -> Option < & Path > {
829
+ self . cc [ target] . 1 . as_ref ( ) . map ( |p| & * * p )
830
830
}
831
831
832
832
/// Returns the path to the C++ compiler for the target specified, may panic
0 commit comments