Skip to content

Commit 8b9bcda

Browse files
authored
Merge pull request #8 from dtolnay/doc
Document extern crate link_cplusplus;
2 parents 35da608 + 3808abe commit 8b9bcda

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ neither of which are good experiences.
2424
## Options
2525

2626
An application or library that is fine with either of libstdc++ or libc++ being
27-
linked, whichever is the platform's default, should use:
27+
linked, whichever is the platform's default, should use the following in
28+
Cargo.toml:
2829

2930
```toml
3031
[dependencies]
@@ -50,6 +51,16 @@ flags from its build script can make this crate do nothing by using:
5051
link-cplusplus = { version = "1.0", features = ["nothing"] }
5152
```
5253

54+
Lastly, make sure to add an explicit `extern crate` dependency to your crate
55+
root, since the link-cplusplus crate will be otherwise unused and its link flags
56+
dropped.
57+
58+
```rust
59+
// src/lib.rs
60+
61+
extern crate link_cplusplus;
62+
```
63+
5364
<br>
5465

5566
#### License

src/lib.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
//! # Options
2727
//!
2828
//! An application or library that is fine with either of libstdc++ or libc++
29-
//! being linked, whichever is the platform's default, should use:
29+
//! being linked, whichever is the platform's default, should use the following
30+
//! in Cargo.toml:
3031
//!
3132
//! ```toml
3233
//! [dependencies]
@@ -51,3 +52,13 @@
5152
//! [dependencies]
5253
//! link-cplusplus = { version = "1.0", features = ["nothing"] }
5354
//! ```
55+
//!
56+
//! Lastly, make sure to add an explicit `extern crate` dependency to your crate
57+
//! root, since the link-cplusplus crate will be otherwise unused and its link
58+
//! flags dropped.
59+
//!
60+
//! ```
61+
//! // src/lib.rs
62+
//!
63+
//! extern crate link_cplusplus;
64+
//! ```

0 commit comments

Comments
 (0)