Rename Cargo features to libstdc++ and libc++

This commit is contained in:
David Tolnay 2020-09-25 17:39:51 -04:00
parent 58f4f40f93
commit 37fb86a4aa
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
4 changed files with 12 additions and 8 deletions

View File

@ -14,9 +14,13 @@ cc = "1.0"
[features]
default = [] # automatic
libstdcxx = [] # force libstdc++
libcxx = [] # force libc++
"libstdc++" = [] # force libstdc++
"libc++" = [] # force libc++
nothing = [] # link nothing, determined somewhere else
# deprecated aliases
libstdcxx = ["libstdc++"]
libcxx = ["libc++"]
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -35,11 +35,11 @@ An application that wants a particular one or the other linked should use:
```toml
[dependencies]
link-cplusplus = { version = "1.0", features = ["libstdcxx"] }
link-cplusplus = { version = "1.0", features = ["libstdc++"] }
# or
link-cplusplus = { version = "1.0", features = ["libcxx"] }
link-cplusplus = { version = "1.0", features = ["libc++"] }
```
An application that wants to handle its own more complicated logic for link

View File

@ -3,8 +3,8 @@ use std::fs;
use std::path::PathBuf;
fn main() {
let libstdcxx = cfg!(feature = "libstdcxx");
let libcxx = cfg!(feature = "libcxx");
let libstdcxx = cfg!(feature = "libstdc++");
let libcxx = cfg!(feature = "libc++");
let nothing = cfg!(feature = "nothing");
if nothing {

View File

@ -37,11 +37,11 @@
//!
//! ```toml
//! [dependencies]
//! link-cplusplus = { version = "1.0", features = ["libstdcxx"] }
//! link-cplusplus = { version = "1.0", features = ["libstdc++"] }
//!
//! # or
//!
//! link-cplusplus = { version = "1.0", features = ["libcxx"] }
//! link-cplusplus = { version = "1.0", features = ["libc++"] }
//! ```
//!
//! An application that wants to handle its own more complicated logic for link