Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusted zig cc judgment and avoided zigbuild errors(#1360) #1361

Merged
merged 4 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,10 @@ impl Build {
cmd.args(self.asm_flags.iter().map(std::ops::Deref::deref));
}

if compiler.supports_path_delimiter() && !is_assembler_msvc {
if compiler.supports_path_delimiter()
&& !is_assembler_msvc
&& matches!(compiler.family, ToolFamily::Clang { zig_cc: false })
phoepsilonix marked this conversation as resolved.
Show resolved Hide resolved
{
// #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
Expand Down
6 changes: 6 additions & 0 deletions src/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ impl Tool {
)
.map(|o| String::from_utf8_lossy(&o).contains("ziglang"))
.unwrap_or_default()
|| {
match path.file_name().map(OsStr::to_string_lossy) {
Some(fname) => fname.contains("zig"),
_ => false,
}
}
NobodyXu marked this conversation as resolved.
Show resolved Hide resolved
}

fn guess_family_from_stdout(
Expand Down
Loading