]> git.proxmox.com Git - cargo.git/commitdiff
reference: Update syntax supported by `rustc-link-lib`
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Tue, 17 May 2022 11:51:58 +0000 (14:51 +0300)
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Tue, 17 May 2022 11:51:58 +0000 (14:51 +0300)
src/doc/src/reference/build-scripts.md

index 8c7729d52c23fd943fd19d0e2c5d4458298ef21c..e49c00af366a8b31269732480c1a5e711f0529dc 100644 (file)
@@ -106,7 +106,7 @@ one detailed below.
   flags to a linker for examples.
 * [`cargo:rustc-link-arg-benches=FLAG`](#rustc-link-arg-benches) – Passes custom
   flags to a linker for benchmarks.
-* [`cargo:rustc-link-lib=[KIND=]NAME`](#rustc-link-lib) — Adds a library to
+* [`cargo:rustc-link-lib=LIB`](#rustc-link-lib) — Adds a library to
   link.
 * [`cargo:rustc-link-search=[KIND=]PATH`](#rustc-link-search) — Adds to the
   library search path.
@@ -153,12 +153,16 @@ to set a linker script or other linker options.
 
 
 <a id="rustc-link-lib"></a>
-#### `cargo:rustc-link-lib=[KIND=]NAME`
+#### `cargo:rustc-link-lib=LIB`
 
 The `rustc-link-lib` instruction tells Cargo to link the given library using
 the compiler's [`-l` flag][option-link]. This is typically used to link a
 native library using [FFI].
 
+The `LIB` string is passed directly to rustc, so it supports any syntax that
+`-l` does. \
+Currently the full supported syntax for `LIB` is `[KIND[:MODIFIERS]=]NAME[:RENAME]`.
+
 The `-l` flag is only passed to the library target of the package, unless
 there is no library target, in which case it is passed to all targets. This is
 done because all other targets have an implicit dependency on the library