From c34e0f94d8e7bbbd709097b2a7332a56d1f9e452 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 12 Jan 2025 15:49:46 +1100 Subject: [PATCH 1/4] Fix compilation on macOS using clang and fix zig-cc --- src/tool.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tool.rs b/src/tool.rs index af43a918..3709d6e3 100644 --- a/src/tool.rs +++ b/src/tool.rs @@ -430,7 +430,7 @@ impl Tool { pub(crate) fn supports_path_delimiter(&self) -> bool { matches!( self.family, - ToolFamily::Clang { .. } | ToolFamily::Msvc { clang_cl: true } + ToolFamily::Msvc { clang_cl: true } ) && !self.cuda } } From c6eeadee13e885a56783b2010826992a74d3aee7 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 12 Jan 2025 15:51:04 +1100 Subject: [PATCH 2/4] Reenable test detecting the regression --- tests/test.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test.rs b/tests/test.rs index 84d3e005..b88a8190 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -405,8 +405,6 @@ fn gnu_static() { } #[test] -// on macOS, cc/gcc is link to apple clang -#[cfg_attr(target_os = "macos", ignore)] fn gnu_no_dash_dash() { let test = Test::gnu(); test.gcc().file("foo.c").compile("foo"); From 172da47fc1c34754c55273386787e3967bfe82e0 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 12 Jan 2025 15:53:55 +1100 Subject: [PATCH 3/4] Fix fmt in tool.rs --- src/tool.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/tool.rs b/src/tool.rs index 3709d6e3..e1307c04 100644 --- a/src/tool.rs +++ b/src/tool.rs @@ -428,10 +428,7 @@ impl Tool { /// Supports using `--` delimiter to separate arguments and path to source files. pub(crate) fn supports_path_delimiter(&self) -> bool { - matches!( - self.family, - ToolFamily::Msvc { clang_cl: true } - ) && !self.cuda + matches!(self.family, ToolFamily::Msvc { clang_cl: true }) && !self.cuda } } From aced6f6d9b27bf12cf74ccd25cbc95cfe8f9be05 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 12 Jan 2025 16:12:46 +1100 Subject: [PATCH 4/4] Add comment --- src/tool.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tool.rs b/src/tool.rs index e1307c04..bfd2d177 100644 --- a/src/tool.rs +++ b/src/tool.rs @@ -428,6 +428,7 @@ impl Tool { /// Supports using `--` delimiter to separate arguments and path to source files. pub(crate) fn supports_path_delimiter(&self) -> bool { + // homebrew clang and zig-cc does not support this while stock version does matches!(self.family, ToolFamily::Msvc { clang_cl: true }) && !self.cuda } }