Skip to content

Commit

Permalink
Remove workaround for broken cc-rs versions (#235)
Browse files Browse the repository at this point in the history
The workaround introduced in #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 rust-lang/cc-rs#1225 /
rust-lang/cc-rs#1252.

Additionally, deprecate `uses_cxx11` which was introduced in the same
PR.

Fixes rust-lang/cc-rs#1276.

I didn't update the dependency to anything specific, just a version that
I know has the fix.
  • Loading branch information
madsmtm authored Feb 10, 2025
1 parent 0542060 commit 6835f7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ categories = ["development-tools::build-utils"]
edition = "2021"

[dependencies]
cc = "1.0.83"
cc = "1.1.0"
9 changes: 2 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"));

Expand Down

0 comments on commit 6835f7c

Please sign in to comment.