@@ -105,6 +105,8 @@ one detailed below.
105105 to re-run the script.
106106* [ ` cargo::rustc-link-arg=FLAG ` ] ( #rustc-link-arg ) --- Passes custom flags to a
107107 linker for benchmarks, binaries, ` cdylib ` crates, examples, and tests.
108+ * [ ` cargo::rustc-link-arg-cdylib=FLAG ` ] ( #rustc-cdylib-link-arg ) --- Passes custom
109+ flags to a linker for cdylib crates.
108110* [ ` cargo::rustc-link-arg-bin=BIN=FLAG ` ] ( #rustc-link-arg-bin ) --- Passes custom
109111 flags to a linker for the binary ` BIN ` .
110112* [ ` cargo::rustc-link-arg-bins=FLAG ` ] ( #rustc-link-arg-bins ) --- Passes custom
@@ -126,8 +128,6 @@ one detailed below.
126128* [ ` cargo::rustc-check-cfg=CHECK_CFG ` ] ( #rustc-check-cfg ) -- Register custom ` cfg ` s as
127129 expected for compile-time checking of configs.
128130* [ ` cargo::rustc-env=VAR=VALUE ` ] ( #rustc-env ) --- Sets an environment variable.
129- * [ ` cargo::rustc-cdylib-link-arg=FLAG ` ] ( #rustc-cdylib-link-arg ) --- Passes custom
130- flags to a linker for cdylib crates.
131131- [ ` cargo::error=MESSAGE ` ] ( #cargo-error ) --- Displays an error on the terminal.
132132* [ ` cargo::warning=MESSAGE ` ] ( #cargo-warning ) --- Displays a warning on the
133133 terminal.
@@ -147,6 +147,16 @@ linker script.
147147
148148[ link-arg ] : ../../rustc/codegen-options/index.md#link-arg
149149
150+ ### ` cargo::rustc-link-arg-cdylib=FLAG ` {#rustc-cdylib-link-arg}
151+
152+ The ` rustc-link-arg-cdylib ` instruction tells Cargo to pass the [ `-C
153+ link-arg=FLAG` option] [ link-arg ] to the compiler, but only when building a
154+ ` cdylib ` library target. Its usage is highly platform specific. It is useful
155+ to set the shared library version or the runtime-path.
156+
157+ For historical reasons, the ` cargo::rustc-cdylib-link-arg ` form is an alias
158+ for ` cargo::rustc-link-arg-cdylib ` , and has the same meaning.
159+
150160### ` cargo::rustc-link-arg-bin=BIN=FLAG ` {#rustc-link-arg-bin}
151161
152162The ` rustc-link-arg-bin ` instruction tells Cargo to pass the [ `-C
@@ -161,6 +171,24 @@ link-arg=FLAG` option][link-arg] to the compiler, but only when building a
161171binary target. Its usage is highly platform specific. It is useful
162172to set a linker script or other linker options.
163173
174+ ### ` cargo::rustc-link-arg-tests=FLAG ` {#rustc-link-arg-tests}
175+
176+ The ` rustc-link-arg-tests ` instruction tells Cargo to pass the [ `-C
177+ link-arg=FLAG` option] [ link-arg ] to the compiler, but only when building a
178+ tests target.
179+
180+ ### ` cargo::rustc-link-arg-examples=FLAG ` {#rustc-link-arg-examples}
181+
182+ The ` rustc-link-arg-examples ` instruction tells Cargo to pass the [ `-C
183+ link-arg=FLAG` option] [ link-arg ] to the compiler, but only when building an examples
184+ target.
185+
186+ ### ` cargo::rustc-link-arg-benches=FLAG ` {#rustc-link-arg-benches}
187+
188+ The ` rustc-link-arg-benches ` instruction tells Cargo to pass the [ `-C
189+ link-arg=FLAG` option] [ link-arg ] to the compiler, but only when building a benchmark
190+ target.
191+
164192### ` cargo::rustc-link-lib=LIB ` {#rustc-link-lib}
165193
166194The ` rustc-link-lib ` instruction tells Cargo to link the given library using
@@ -185,24 +213,6 @@ The optional `KIND` may be one of `dylib`, `static`, or `framework`. See the
185213[ option-link ] : ../../rustc/command-line-arguments.md#option-l-link-lib
186214[ FFI ] : ../../nomicon/ffi.md
187215
188- ### ` cargo::rustc-link-arg-tests=FLAG ` {#rustc-link-arg-tests}
189-
190- The ` rustc-link-arg-tests ` instruction tells Cargo to pass the [ `-C
191- link-arg=FLAG` option] [ link-arg ] to the compiler, but only when building a
192- tests target.
193-
194- ### ` cargo::rustc-link-arg-examples=FLAG ` {#rustc-link-arg-examples}
195-
196- The ` rustc-link-arg-examples ` instruction tells Cargo to pass the [ `-C
197- link-arg=FLAG` option] [ link-arg ] to the compiler, but only when building an examples
198- target.
199-
200- ### ` cargo::rustc-link-arg-benches=FLAG ` {#rustc-link-arg-benches}
201-
202- The ` rustc-link-arg-benches ` instruction tells Cargo to pass the [ `-C
203- link-arg=FLAG` option] [ link-arg ] to the compiler, but only when building a benchmark
204- target.
205-
206216### ` cargo::rustc-link-search=[KIND=]PATH ` {#rustc-link-search}
207217
208218The ` rustc-link-search ` instruction tells Cargo to pass the [ ` -L `
@@ -307,13 +317,6 @@ Cargo][env-cargo].
307317[ env-macro ] : ../../std/macro.env.html
308318[ env-cargo ] : environment-variables.md#environment-variables-cargo-sets-for-crates
309319
310- ### ` cargo::rustc-cdylib-link-arg=FLAG ` {#rustc-cdylib-link-arg}
311-
312- The ` rustc-cdylib-link-arg ` instruction tells Cargo to pass the [ `-C
313- link-arg=FLAG` option] [ link-arg ] to the compiler, but only when building a
314- ` cdylib ` library target. Its usage is highly platform specific. It is useful
315- to set the shared library version or the runtime-path.
316-
317320### ` cargo::error=MESSAGE ` {#cargo-error}
318321
319322The ` error ` instruction tells Cargo to display an error after the build script
0 commit comments