@@ -1104,12 +1104,18 @@ impl Build {
1104
1104
1105
1105
/// Returns the path to the C compiler for the target specified.
1106
1106
fn cc ( & self , target : TargetSelection ) -> PathBuf {
1107
+ if self . config . dry_run ( ) {
1108
+ return PathBuf :: new ( ) ;
1109
+ }
1107
1110
self . cc . borrow ( ) [ & target] . path ( ) . into ( )
1108
1111
}
1109
1112
1110
1113
/// Returns a list of flags to pass to the C compiler for the target
1111
1114
/// specified.
1112
1115
fn cflags ( & self , target : TargetSelection , which : GitRepo , c : CLang ) -> Vec < String > {
1116
+ if self . config . dry_run ( ) {
1117
+ return Vec :: new ( ) ;
1118
+ }
1113
1119
let base = match c {
1114
1120
CLang :: C => self . cc . borrow ( ) [ & target] . clone ( ) ,
1115
1121
CLang :: Cxx => self . cxx . borrow ( ) [ & target] . clone ( ) ,
@@ -1154,16 +1160,25 @@ impl Build {
1154
1160
1155
1161
/// Returns the path to the `ar` archive utility for the target specified.
1156
1162
fn ar ( & self , target : TargetSelection ) -> Option < PathBuf > {
1163
+ if self . config . dry_run ( ) {
1164
+ return None ;
1165
+ }
1157
1166
self . ar . borrow ( ) . get ( & target) . cloned ( )
1158
1167
}
1159
1168
1160
1169
/// Returns the path to the `ranlib` utility for the target specified.
1161
1170
fn ranlib ( & self , target : TargetSelection ) -> Option < PathBuf > {
1171
+ if self . config . dry_run ( ) {
1172
+ return None ;
1173
+ }
1162
1174
self . ranlib . borrow ( ) . get ( & target) . cloned ( )
1163
1175
}
1164
1176
1165
1177
/// Returns the path to the C++ compiler for the target specified.
1166
1178
fn cxx ( & self , target : TargetSelection ) -> Result < PathBuf , String > {
1179
+ if self . config . dry_run ( ) {
1180
+ return Ok ( PathBuf :: new ( ) ) ;
1181
+ }
1167
1182
match self . cxx . borrow ( ) . get ( & target) {
1168
1183
Some ( p) => Ok ( p. path ( ) . into ( ) ) ,
1169
1184
None => {
@@ -1174,6 +1189,9 @@ impl Build {
1174
1189
1175
1190
/// Returns the path to the linker for the given target if it needs to be overridden.
1176
1191
fn linker ( & self , target : TargetSelection ) -> Option < PathBuf > {
1192
+ if self . config . dry_run ( ) {
1193
+ return Some ( PathBuf :: new ( ) ) ;
1194
+ }
1177
1195
if let Some ( linker) = self . config . target_config . get ( & target) . and_then ( |c| c. linker . clone ( ) )
1178
1196
{
1179
1197
Some ( linker)
0 commit comments