File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1311,6 +1311,13 @@ impl Build {
1311
1311
if self . cuda && self . files . len ( ) > 1 {
1312
1312
cmd. arg ( "--device-c" ) ;
1313
1313
}
1314
+ if compiler. family == ( ToolFamily :: Msvc { clang_cl : true } ) {
1315
+ // #513: For `clang-cl`, separate flags/options from the input file.
1316
+ // When cross-compiling macOS -> Windows, this avoids interpreting
1317
+ // common `/Users/...` paths as the `/U` flag and triggering
1318
+ // `-Wslash-u-filename` warning.
1319
+ cmd. arg ( "--" ) ;
1320
+ }
1314
1321
cmd. arg ( & obj. src ) ;
1315
1322
if cfg ! ( target_os = "macos" ) {
1316
1323
self . fix_env_for_apple_os ( & mut cmd) ?;
Original file line number Diff line number Diff line change @@ -343,6 +343,14 @@ fn gnu_static() {
343
343
test. cmd ( 0 ) . must_have ( "-static" ) . must_not_have ( "-shared" ) ;
344
344
}
345
345
346
+ #[ test]
347
+ fn gnu_no_dash_dash ( ) {
348
+ let test = Test :: gnu ( ) ;
349
+ test. gcc ( ) . file ( "foo.c" ) . compile ( "foo" ) ;
350
+
351
+ test. cmd ( 0 ) . must_not_have ( "--" ) ;
352
+ }
353
+
346
354
#[ test]
347
355
fn msvc_smoke ( ) {
348
356
reset_env ( ) ;
@@ -411,3 +419,11 @@ fn msvc_no_static_crt() {
411
419
412
420
test. cmd ( 0 ) . must_have ( "-MD" ) ;
413
421
}
422
+
423
+ #[ test]
424
+ fn msvc_no_dash_dash ( ) {
425
+ let test = Test :: msvc ( ) ;
426
+ test. gcc ( ) . file ( "foo.c" ) . compile ( "foo" ) ;
427
+
428
+ test. cmd ( 0 ) . must_not_have ( "--" ) ;
429
+ }
You can’t perform that action at this time.
0 commit comments