Skip to content

Commit 064afa6

Browse files
committed
Document the rustc-cdylib-link-arg key
1 parent 9741016 commit 064afa6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ cargo:rustc-link-lib=static=foo
6262
cargo:rustc-link-search=native=/path/to/foo
6363
cargo:rustc-cfg=foo
6464
cargo:rustc-env=FOO=bar
65+
cargo:rustc-cdylib-link-arg=-Wl,-soname,libfoo.so.1.2.3
6566
# arbitrary user-defined metadata
6667
cargo:root=/path/to/foo
6768
cargo:libdir=/path/to/foo/lib
@@ -93,6 +94,9 @@ crate is built:
9394
This is useful for embedding additional metadata in crate's code,
9495
such as the hash of Git HEAD or the unique identifier of a continuous
9596
integration server.
97+
* `rustc-cdylib-link-arg=FLAG` is a flag passed to the compiler as
98+
`-C link-arg=FLAG` when building a `cdylib`. Its usage is highly platform
99+
specific. It is useful to set the shared library version or the runtime-path.
96100
* `rerun-if-changed=PATH` is a path to a file or directory which indicates that
97101
the build script should be re-run if it changes (detected by a more-recent
98102
last-modified timestamp on the file). Normally build scripts are re-run if

0 commit comments

Comments
 (0)