From cb043839c1ecb4171c82772858e18bb68cf872de Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 2 Jun 2024 15:25:38 +1000 Subject: [PATCH 1/2] Deprecate cc::Build::static_flag cc generates an archive, so -static doesn't make sense --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 9b2816fcf..05298cfd8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -764,6 +764,10 @@ impl Build { /// .static_flag(true) /// .compile("foo"); /// ``` + #[deprecated( + since = "1.0.99", + note = "cc itself always generates a archive. If you use cc::Tool::to_command(), then you shall manually add -static to command" + )] pub fn static_flag(&mut self, static_flag: bool) -> &mut Build { self.static_flag = Some(static_flag); self From 76bd799c185b0d2270be6e1b37de563379fa63a6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 8 Jun 2024 18:53:05 +1000 Subject: [PATCH 2/2] Update src/lib.rs Co-authored-by: Thom Chiovoloni --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 05298cfd8..831206374 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -766,7 +766,7 @@ impl Build { /// ``` #[deprecated( since = "1.0.99", - note = "cc itself always generates a archive. If you use cc::Tool::to_command(), then you shall manually add -static to command" + note = "cc itself always generates an archive. If you really need `-static`, use `cc::Tool::to_command()` and add it to the `Command` arguments." )] pub fn static_flag(&mut self, static_flag: bool) -> &mut Build { self.static_flag = Some(static_flag);