Merge pull request #8 from dtolnay/doc

Document extern crate link_cplusplus;
This commit is contained in:
David Tolnay 2021-01-11 15:57:49 -08:00 committed by GitHub
commit 8b9bcdac20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 2 deletions

View File

@ -24,7 +24,8 @@ neither of which are good experiences.
## Options
An application or library that is fine with either of libstdc++ or libc++ being
linked, whichever is the platform's default, should use:
linked, whichever is the platform's default, should use the following in
Cargo.toml:
```toml
[dependencies]
@ -50,6 +51,16 @@ flags from its build script can make this crate do nothing by using:
link-cplusplus = { version = "1.0", features = ["nothing"] }
```
Lastly, make sure to add an explicit `extern crate` dependency to your crate
root, since the link-cplusplus crate will be otherwise unused and its link flags
dropped.
```rust
// src/lib.rs
extern crate link_cplusplus;
```
<br>
#### License

View File

@ -26,7 +26,8 @@
//! # Options
//!
//! An application or library that is fine with either of libstdc++ or libc++
//! being linked, whichever is the platform's default, should use:
//! being linked, whichever is the platform's default, should use the following
//! in Cargo.toml:
//!
//! ```toml
//! [dependencies]
@ -51,3 +52,13 @@
//! [dependencies]
//! link-cplusplus = { version = "1.0", features = ["nothing"] }
//! ```
//!
//! Lastly, make sure to add an explicit `extern crate` dependency to your crate
//! root, since the link-cplusplus crate will be otherwise unused and its link
//! flags dropped.
//!
//! ```
//! // src/lib.rs
//!
//! extern crate link_cplusplus;
//! ```