Skip to content

Commit

Permalink
Add -- for files in try_expand (like in rust-lang#514) (rust-lang…
Browse files Browse the repository at this point in the history
…#911)

* fix

* format
  • Loading branch information
pashokitsme authored Dec 18, 2023
1 parent 987cd25 commit 802399f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1542,6 +1542,21 @@ impl Build {
"Expand may only be called for a single file"
);

let is_asm = self
.files
.iter()
.map(std::ops::Deref::deref)
.find_map(AsmFileExt::from_path)
.is_some();

if compiler.family == (ToolFamily::Msvc { clang_cl: true }) && !is_asm {
// #513: For `clang-cl`, separate flags/options from the input file.
// When cross-compiling macOS -> Windows, this avoids interpreting
// common `/Users/...` paths as the `/U` flag and triggering
// `-Wslash-u-filename` warning.
cmd.arg("--");
}

cmd.args(self.files.iter().map(std::ops::Deref::deref));

let name = compiler
Expand Down

0 comments on commit 802399f

Please sign in to comment.