Skip to content

Commit 53ec56c

Browse files
committed
reference: Update syntax supported by rustc-link-lib
1 parent 6d6dd9d commit 53ec56c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/doc/src/reference/build-scripts.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ one detailed below.
106106
flags to a linker for examples.
107107
* [`cargo:rustc-link-arg-benches=FLAG`](#rustc-link-arg-benches) – Passes custom
108108
flags to a linker for benchmarks.
109-
* [`cargo:rustc-link-lib=[KIND=]NAME`](#rustc-link-lib) — Adds a library to
109+
* [`cargo:rustc-link-lib=LIB`](#rustc-link-lib) — Adds a library to
110110
link.
111111
* [`cargo:rustc-link-search=[KIND=]PATH`](#rustc-link-search) — Adds to the
112112
library search path.
@@ -153,12 +153,16 @@ to set a linker script or other linker options.
153153

154154

155155
<a id="rustc-link-lib"></a>
156-
#### `cargo:rustc-link-lib=[KIND=]NAME`
156+
#### `cargo:rustc-link-lib=LIB`
157157

158158
The `rustc-link-lib` instruction tells Cargo to link the given library using
159159
the compiler's [`-l` flag][option-link]. This is typically used to link a
160160
native library using [FFI].
161161

162+
The `LIB` string is passed directly to rustc, so it supports any syntax that
163+
`-l` does. \
164+
Currently the full supported syntax for `LIB` is `[KIND[:MODIFIERS]=]NAME[:RENAME]`.
165+
162166
The `-l` flag is only passed to the library target of the package, unless
163167
there is no library target, in which case it is passed to all targets. This is
164168
done because all other targets have an implicit dependency on the library

0 commit comments

Comments
 (0)