File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -701,10 +701,13 @@ impl Build {
701701 if compiler. family . verbose_stderr ( ) {
702702 compiler. remove_arg ( "-v" . into ( ) ) ;
703703 }
704- if compiler. is_like_clang ( ) {
705- // Avoid reporting that the arg is unsupported just because the
706- // compiler complains that it wasn't used.
707- compiler. push_cc_arg ( "-Wno-unused-command-line-argument" . into ( ) ) ;
704+
705+ if compiler. supports_path_delimiter ( ) && !is_assembler_msvc {
706+ // #513: For `clang-cl`, separate flags/options from the input file.
707+ // When cross-compiling macOS -> Windows, this avoids interpreting
708+ // common `/Users/...` paths as the `/U` flag and triggering
709+ // `-Wslash-u-filename` warning.
710+ cmd. arg ( "--" ) ;
708711 }
709712
710713 let mut cmd = compiler. to_command ( ) ;
Original file line number Diff line number Diff line change @@ -426,7 +426,7 @@ impl Tool {
426426 matches ! (
427427 self . family,
428428 ToolFamily :: Clang { .. } | ToolFamily :: Msvc { clang_cl: true }
429- )
429+ ) && ! self . cuda
430430 }
431431}
432432
You can’t perform that action at this time.
0 commit comments