Skip to content

Commit 76f4f6c

Browse files
committed
Do not use -- for cuda
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
1 parent 2161803 commit 76f4f6c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff 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();

src/tool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)