From bd8956c68b7c033dcf535f81f3ea98b6a8a950a0 Mon Sep 17 00:00:00 2001 From: pashokitsme Date: Tue, 12 Dec 2023 10:49:41 +0300 Subject: [PATCH 1/2] fix --- src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 42278a79..2610d22a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1542,6 +1542,16 @@ 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 From 4f257df7bdb85f952a0b191082ececc5260ddd21 Mon Sep 17 00:00:00 2001 From: pashokitsme Date: Wed, 13 Dec 2023 14:08:37 +0300 Subject: [PATCH 2/2] format --- src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 2610d22a..6b641a4c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1542,7 +1542,12 @@ 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(); + 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.