@@ -105,6 +105,8 @@ one detailed below.
105
105
to re-run the script.
106
106
* [ ` cargo::rustc-link-arg=FLAG ` ] ( #rustc-link-arg ) --- Passes custom flags to a
107
107
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.
108
110
* [ ` cargo::rustc-link-arg-bin=BIN=FLAG ` ] ( #rustc-link-arg-bin ) --- Passes custom
109
111
flags to a linker for the binary ` BIN ` .
110
112
* [ ` cargo::rustc-link-arg-bins=FLAG ` ] ( #rustc-link-arg-bins ) --- Passes custom
@@ -126,8 +128,6 @@ one detailed below.
126
128
* [ ` cargo::rustc-check-cfg=CHECK_CFG ` ] ( #rustc-check-cfg ) -- Register custom ` cfg ` s as
127
129
expected for compile-time checking of configs.
128
130
* [ ` 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.
131
131
- [ ` cargo::error=MESSAGE ` ] ( #cargo-error ) --- Displays an error on the terminal.
132
132
* [ ` cargo::warning=MESSAGE ` ] ( #cargo-warning ) --- Displays a warning on the
133
133
terminal.
@@ -147,6 +147,16 @@ linker script.
147
147
148
148
[ link-arg ] : ../../rustc/codegen-options/index.md#link-arg
149
149
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
+
150
160
### ` cargo::rustc-link-arg-bin=BIN=FLAG ` {#rustc-link-arg-bin}
151
161
152
162
The ` 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
161
171
binary target. Its usage is highly platform specific. It is useful
162
172
to set a linker script or other linker options.
163
173
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
+
164
192
### ` cargo::rustc-link-lib=LIB ` {#rustc-link-lib}
165
193
166
194
The ` 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
185
213
[ option-link ] : ../../rustc/command-line-arguments.md#option-l-link-lib
186
214
[ FFI ] : ../../nomicon/ffi.md
187
215
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
-
206
216
### ` cargo::rustc-link-search=[KIND=]PATH ` {#rustc-link-search}
207
217
208
218
The ` rustc-link-search ` instruction tells Cargo to pass the [ ` -L `
@@ -307,13 +317,6 @@ Cargo][env-cargo].
307
317
[ env-macro ] : ../../std/macro.env.html
308
318
[ env-cargo ] : environment-variables.md#environment-variables-cargo-sets-for-crates
309
319
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
-
317
320
### ` cargo::error=MESSAGE ` {#cargo-error}
318
321
319
322
The ` error ` instruction tells Cargo to display an error after the build script
0 commit comments