Skip to content

Commit c5f8d11

Browse files
mondejagdesmott
authored andcommitted
Fix some errors in docs
1 parent 6d238d4 commit c5f8d11

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ In your `Cargo.toml`:
2727
system-deps = "2.0"
2828
```
2929

30-
Then, to declare a dependency on `testlib >= 1.2`
31-
add the following section:
30+
Then, to declare a dependency on `testlib >= 1.2` add the following section:
3231

3332
```toml
3433
[package.metadata.system-deps]

src/lib.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//! declarative, so other tools can read them as well.
66
//!
77
//! # Usage
8+
//!
89
//! In your `Cargo.toml`:
910
//!
1011
//! ```toml
@@ -78,6 +79,7 @@
7879
//! ```
7980
//!
8081
//! # Fallback library names
82+
//!
8183
//! Some libraries may be available under different names on different platforms or distributions.
8284
//! To allow for this, you can define fallback names to search for if the main library name does not work.
8385
//!
@@ -88,13 +90,16 @@
8890
//!
8991
//! You may also specify different fallback names for different versions:
9092
//!
93+
//! ```toml
9194
//! [package.metadata.system-deps.libfoo]
9295
//! version = "0.1"
9396
//! fallback-names = ["libfoo-0.1"]
9497
//! v1 = { version = "1.0", fallback-names = ["libfoo1"] }
9598
//! v2 = { version = "2.0", fallback-names = ["libfoo2"] }
99+
//! ```
96100
//!
97101
//! # Feature versions
102+
//!
98103
//! `-sys` crates willing to support various versions of their underlying system libraries
99104
//! can use features to control the version of the dependency required.
100105
//! `system-deps` will pick the highest version among enabled features.
@@ -149,8 +154,10 @@
149154
//! - `unix` and `windows`
150155
//!
151156
//! # Overriding build flags
157+
//!
152158
//! By default `system-deps` automatically defines the required build flags for each dependency using the information fetched from `pkg-config`.
153159
//! These flags can be overridden using environment variables if needed:
160+
//!
154161
//! - `SYSTEM_DEPS_$NAME_SEARCH_NATIVE` to override the [`cargo:rustc-link-search=native`](https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-searchkindpath) flag;
155162
//! - `SYSTEM_DEPS_$NAME_SEARCH_FRAMEWORK` to override the [`cargo:rustc-link-search=framework`](https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-searchkindpath) flag;
156163
//! - `SYSTEM_DEPS_$NAME_LIB` to override the [`cargo:rustc-link-lib`](https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib) flag;
@@ -167,6 +174,7 @@
167174
//!
168175
//! `-sys` crates can provide support for building and statically link their underlying system library as part of their build process.
169176
//! Here is how to do this in your `build.rs`:
177+
//!
170178
//! ```should_panic
171179
//! fn main() {
172180
//! system_deps::Config::new()
@@ -181,6 +189,7 @@
181189
//!
182190
//! This feature can be controlled using the `SYSTEM_DEPS_$NAME_BUILD_INTERNAL` environment variable
183191
//! which can have the following values:
192+
//!
184193
//! - `auto`: build the dependency only if the required version has not been found by `pkg-config`;
185194
//! - `always`: always build the dependency, ignoring any version which may be installed on the system;
186195
//! - `never`: (default) never build the dependency, `system-deps` will fail if the required version is not found on the system.
@@ -370,7 +379,7 @@ impl Dependencies {
370379
self.aggregate_path_buf(|l| &l.include_paths)
371380
}
372381

373-
/// Returns a vector of [Library::linker_args] of each library, removing duplicates.
382+
/// Returns a vector of [Library::ld_args] of each library, removing duplicates.
374383
pub fn all_linker_args(&self) -> Vec<&Vec<String>> {
375384
let mut v = self
376385
.libs

0 commit comments

Comments
 (0)