File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -2708,7 +2708,7 @@ impl Build {
2708
2708
let out_dir = self . get_out_dir ( ) . ok ( ) ;
2709
2709
let out_dir = out_dir. as_deref ( ) ;
2710
2710
2711
- if let Some ( c) = & self . compiler {
2711
+ if let Some ( c) = dbg ! ( & self . compiler) {
2712
2712
return Ok ( Tool :: new (
2713
2713
( * * c) . to_owned ( ) ,
2714
2714
& self . build_cache . cached_compiler_family ,
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ fn main() {
15
15
extra_flags ( ) ;
16
16
path_to_ccache ( ) ;
17
17
more_spaces ( ) ;
18
+ clang_cl ( ) ;
18
19
}
19
20
20
21
fn ccache ( ) {
@@ -110,3 +111,18 @@ fn more_spaces() {
110
111
let compiler = test. gcc ( ) . file ( "foo.c" ) . get_compiler ( ) ;
111
112
assert_eq ! ( compiler. path( ) , Path :: new( "cc" ) ) ;
112
113
}
114
+
115
+ fn clang_cl ( ) {
116
+ for exe_suffix in [ "" , ".exe" ] {
117
+ let test = Test :: clang ( ) ;
118
+ let bin = format ! ( "clang{exe_suffix}" ) ;
119
+ env:: set_var ( "CC" , & format ! ( "{bin} --driver-mode=cl" ) ) ;
120
+ let test_compiler = |build : cc:: Build | {
121
+ let compiler = build. get_compiler ( ) ;
122
+ assert_eq ! ( compiler. path( ) , Path :: new( & * bin) ) ;
123
+ assert ! ( compiler. is_like_msvc( ) ) ;
124
+ assert ! ( compiler. is_like_clang_cl( ) ) ;
125
+ } ;
126
+ test_compiler ( test. gcc ( ) ) ;
127
+ }
128
+ }
You can’t perform that action at this time.
0 commit comments