Skip to content

Commit 0d082a2

Browse files
authored
Separate source args with -- when compiling assembly with clang-cl (#857)
1 parent bfc3ba4 commit 0d082a2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,7 +1512,8 @@ impl Build {
15121512
let clang = compiler.family == ToolFamily::Clang;
15131513
let gnu = compiler.family == ToolFamily::Gnu;
15141514

1515-
let (mut cmd, name) = if msvc && asm_ext == Some(AsmFileExt::DotAsm) {
1515+
let is_assembler_msvc = msvc && asm_ext == Some(AsmFileExt::DotAsm);
1516+
let (mut cmd, name) = if is_assembler_msvc {
15161517
self.msvc_macro_assembler()?
15171518
} else {
15181519
let mut cmd = compiler.to_command();
@@ -1543,7 +1544,7 @@ impl Build {
15431544
if is_asm {
15441545
cmd.args(self.asm_flags.iter().map(std::ops::Deref::deref));
15451546
}
1546-
if compiler.family == (ToolFamily::Msvc { clang_cl: true }) && !is_asm {
1547+
if compiler.family == (ToolFamily::Msvc { clang_cl: true }) && !is_assembler_msvc {
15471548
// #513: For `clang-cl`, separate flags/options from the input file.
15481549
// When cross-compiling macOS -> Windows, this avoids interpreting
15491550
// common `/Users/...` paths as the `/U` flag and triggering

0 commit comments

Comments
 (0)