mirror of
https://gitee.com/openharmony/third_party_rust_link-cplusplus
synced 2024-11-23 07:19:41 +00:00
Merge pull request #8 from dtolnay/doc
Document extern crate link_cplusplus;
This commit is contained in:
commit
8b9bcdac20
13
README.md
13
README.md
@ -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
|
||||
|
13
src/lib.rs
13
src/lib.rs
@ -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;
|
||||
//! ```
|
||||
|
Loading…
Reference in New Issue
Block a user