Skip to content

Commit 802399f

Browse files
authored
Add -- for files in try_expand (like in #514) (#911)
* fix * format
1 parent 987cd25 commit 802399f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,6 +1542,21 @@ impl Build {
15421542
"Expand may only be called for a single file"
15431543
);
15441544

1545+
let is_asm = self
1546+
.files
1547+
.iter()
1548+
.map(std::ops::Deref::deref)
1549+
.find_map(AsmFileExt::from_path)
1550+
.is_some();
1551+
1552+
if compiler.family == (ToolFamily::Msvc { clang_cl: true }) && !is_asm {
1553+
// #513: For `clang-cl`, separate flags/options from the input file.
1554+
// When cross-compiling macOS -> Windows, this avoids interpreting
1555+
// common `/Users/...` paths as the `/U` flag and triggering
1556+
// `-Wslash-u-filename` warning.
1557+
cmd.arg("--");
1558+
}
1559+
15451560
cmd.args(self.files.iter().map(std::ops::Deref::deref));
15461561

15471562
let name = compiler

0 commit comments

Comments
 (0)