From 6835f7c16b9151d3bd2490c8d539328113b61c86 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Mon, 10 Feb 2025 01:30:02 +0100 Subject: [PATCH] Remove workaround for broken `cc-rs` versions (#235) The workaround introduced in https://github.com/rust-lang/cmake-rs/pull/39 is no longer necessary since `cc-rs` handles C++ requirements internally, and is in fact detrimental since `cc-rs` has required the target to be a `rustc` target triple since https://github.com/rust-lang/cc-rs/pull/1225 / https://github.com/rust-lang/cc-rs/pull/1252. Additionally, deprecate `uses_cxx11` which was introduced in the same PR. Fixes https://github.com/rust-lang/cc-rs/issues/1276. I didn't update the dependency to anything specific, just a version that I know has the fix. --- Cargo.toml | 2 +- src/lib.rs | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c6f9e20..8a106b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,4 +15,4 @@ categories = ["development-tools::build-utils"] edition = "2021" [dependencies] -cc = "1.0.83" +cc = "1.1.0" diff --git a/src/lib.rs b/src/lib.rs index 9054673..57d4a43 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -387,6 +387,7 @@ impl Config { /// /// This does not otherwise affect any CXX flags, i.e. it does not set /// -std=c++11 or -stdlib=libc++. + #[deprecated = "no longer does anything, C++ is determined based on `cc::Build`, and the macOS issue has been fixed upstream"] pub fn uses_cxx11(&mut self) -> &mut Config { self.uses_cxx11 = true; self @@ -440,13 +441,7 @@ impl Config { pub fn build(&mut self) -> PathBuf { let target = match self.target.clone() { Some(t) => t, - None => { - let mut t = getenv_unwrap("TARGET"); - if t.ends_with("-darwin") && self.uses_cxx11 { - t += "11" - } - t - } + None => getenv_unwrap("TARGET"), }; let host = self.host.clone().unwrap_or_else(|| getenv_unwrap("HOST"));