@@ -192,6 +192,7 @@ pub struct Tool {
192
192
family : ToolFamily ,
193
193
cuda : bool ,
194
194
removed_args : Vec < OsString > ,
195
+ has_internal_target_arg : bool ,
195
196
}
196
197
197
198
/// Represents the family of tools this tool belongs to.
@@ -1566,8 +1567,7 @@ impl Build {
1566
1567
// Target flags
1567
1568
match cmd. family {
1568
1569
ToolFamily :: Clang => {
1569
- if !( target. contains ( "android" )
1570
- && android_clang_compiler_uses_target_arg_internally ( & cmd. path ) )
1570
+ if !( target. contains ( "android" ) && cmd. has_internal_target_arg )
1571
1571
{
1572
1572
if target. contains ( "darwin" ) {
1573
1573
if let Some ( arch) =
@@ -2358,6 +2358,7 @@ impl Build {
2358
2358
let file_name = path. to_str ( ) . unwrap ( ) . to_owned ( ) ;
2359
2359
let ( target, clang) = file_name. split_at ( file_name. rfind ( "-" ) . unwrap ( ) ) ;
2360
2360
2361
+ tool. has_internal_target_arg = true ;
2361
2362
tool. path . set_file_name ( clang. trim_start_matches ( "-" ) ) ;
2362
2363
tool. path . set_extension ( "exe" ) ;
2363
2364
tool. args . push ( format ! ( "--target={}" , target) . into ( ) ) ;
@@ -2898,6 +2899,7 @@ impl Tool {
2898
2899
family : family,
2899
2900
cuda : false ,
2900
2901
removed_args : Vec :: new ( ) ,
2902
+ has_internal_target_arg : false ,
2901
2903
}
2902
2904
}
2903
2905
@@ -2929,6 +2931,7 @@ impl Tool {
2929
2931
family : family,
2930
2932
cuda : cuda,
2931
2933
removed_args : Vec :: new ( ) ,
2934
+ has_internal_target_arg : false ,
2932
2935
}
2933
2936
}
2934
2937
0 commit comments