@@ -1104,12 +1104,18 @@ impl Build {
11041104
11051105 /// Returns the path to the C compiler for the target specified.
11061106 fn cc ( & self , target : TargetSelection ) -> PathBuf {
1107+ if self . config . dry_run ( ) {
1108+ return PathBuf :: new ( ) ;
1109+ }
11071110 self . cc . borrow ( ) [ & target] . path ( ) . into ( )
11081111 }
11091112
11101113 /// Returns a list of flags to pass to the C compiler for the target
11111114 /// specified.
11121115 fn cflags ( & self , target : TargetSelection , which : GitRepo , c : CLang ) -> Vec < String > {
1116+ if self . config . dry_run ( ) {
1117+ return Vec :: new ( ) ;
1118+ }
11131119 let base = match c {
11141120 CLang :: C => self . cc . borrow ( ) [ & target] . clone ( ) ,
11151121 CLang :: Cxx => self . cxx . borrow ( ) [ & target] . clone ( ) ,
@@ -1154,16 +1160,25 @@ impl Build {
11541160
11551161 /// Returns the path to the `ar` archive utility for the target specified.
11561162 fn ar ( & self , target : TargetSelection ) -> Option < PathBuf > {
1163+ if self . config . dry_run ( ) {
1164+ return None ;
1165+ }
11571166 self . ar . borrow ( ) . get ( & target) . cloned ( )
11581167 }
11591168
11601169 /// Returns the path to the `ranlib` utility for the target specified.
11611170 fn ranlib ( & self , target : TargetSelection ) -> Option < PathBuf > {
1171+ if self . config . dry_run ( ) {
1172+ return None ;
1173+ }
11621174 self . ranlib . borrow ( ) . get ( & target) . cloned ( )
11631175 }
11641176
11651177 /// Returns the path to the C++ compiler for the target specified.
11661178 fn cxx ( & self , target : TargetSelection ) -> Result < PathBuf , String > {
1179+ if self . config . dry_run ( ) {
1180+ return Ok ( PathBuf :: new ( ) ) ;
1181+ }
11671182 match self . cxx . borrow ( ) . get ( & target) {
11681183 Some ( p) => Ok ( p. path ( ) . into ( ) ) ,
11691184 None => {
@@ -1174,6 +1189,9 @@ impl Build {
11741189
11751190 /// Returns the path to the linker for the given target if it needs to be overridden.
11761191 fn linker ( & self , target : TargetSelection ) -> Option < PathBuf > {
1192+ if self . config . dry_run ( ) {
1193+ return Some ( PathBuf :: new ( ) ) ;
1194+ }
11771195 if let Some ( linker) = self . config . target_config . get ( & target) . and_then ( |c| c. linker . clone ( ) )
11781196 {
11791197 Some ( linker)
0 commit comments