@@ -91,26 +91,32 @@ <h3 id="cargo_build_target_selection">Target Selection</h3>
91
91
</ dd >
92
92
< dt class ="hdlist1 "> < strong > --tests</ strong > </ dt >
93
93
< dd >
94
- < p > Build all tests. This includes both unit tests for libraries and binaries
95
- and integration tests. Targets may be disabled by setting < code > test = false</ code >
96
- in the manifest settings for the target. Targets (such as examples) may be
97
- explicitly included by setting < code > test = true</ code > in the target settings.</ p >
94
+ < p > Build all targets in test mode that have the < code > test = true</ code > manifest
95
+ flag set. By default this includes the library and binaries built as
96
+ unittests, and integration tests. Be aware that this will also build any
97
+ required dependencies, so the lib target may be built twice (once as a
98
+ unittest, and once as a dependency for binaries, integration tests, etc.).
99
+ Targets may be enabled or disabled by setting the < code > test</ code > flag in the
100
+ manifest settings for the target.</ p >
98
101
</ dd >
99
102
< dt class ="hdlist1 "> < strong > --bench</ strong > < em > NAME</ em > …​</ dt >
100
103
< dd >
101
104
< p > Build the specified benchmark. This flag may be specified multiple times.</ p >
102
105
</ dd >
103
106
< dt class ="hdlist1 "> < strong > --benches</ strong > </ dt >
104
107
< dd >
105
- < p > Build all benchmarks. This includes both unit benchmarks for libraries and
106
- binaries and bench targets. Targets may be disabled by setting < code > bench =
107
- false</ code > in the manifest settings for the target. Targets (such as examples)
108
- may be explicitly included by setting < code > bench = true</ code > in the target
109
- settings.</ p >
108
+ < p > Build all targets in benchmark mode that have the < code > bench = true</ code >
109
+ manifest flag set. By default this includes the library and binaries built
110
+ as benchmarks, and bench targets. Be aware that this will also build any
111
+ required dependencies, so the lib target may be built twice (once as a
112
+ benchmark, and once as a dependency for binaries, benchmarks, etc.).
113
+ Targets may be enabled or disabled by setting the < code > bench</ code > flag in the
114
+ manifest settings for the target.</ p >
110
115
</ dd >
111
116
< dt class ="hdlist1 "> < strong > --all-targets</ strong > </ dt >
112
117
< dd >
113
- < p > Build all targets.</ p >
118
+ < p > Build all targets. This is equivalent to specifying < code > --lib --bins
119
+ --tests --benches --examples</ code > .</ p >
114
120
</ dd >
115
121
</ dl >
116
122
</ div >
@@ -147,48 +153,18 @@ <h3 id="cargo_build_compilation_options">Compilation Options</h3>
147
153
< dl >
148
154
< dt class ="hdlist1 "> < strong > --target</ strong > < em > TRIPLE</ em > </ dt >
149
155
< dd >
150
- < p > Build for the given architecture. The default is the host architecture.</ p >
151
- < div class ="paragraph ">
152
- < p > The general format of the triple is < code > <arch><sub>-<vendor>-<sys>-<abi></ code > where:</ p >
153
- </ div >
154
- < div class ="ulist ">
155
- < ul >
156
- < li >
157
- < p > < code > arch</ code > = The base CPU architecture, for example < code > x86_64</ code > , < code > i686</ code > , < code > arm</ code > ,
158
- < code > thumb</ code > , < code > mips</ code > , etc.</ p >
159
- </ li >
160
- < li >
161
- < p > < code > sub</ code > = The CPU sub-architecture, for example < code > arm</ code > has < code > v7</ code > , < code > v7s</ code > , < code > v5te</ code > ,
162
- etc.</ p >
163
- </ li >
164
- < li >
165
- < p > < code > vendor</ code > = The vendor, for example < code > unknown</ code > , < code > apple</ code > , < code > pc</ code > , < code > linux</ code > , etc.</ p >
166
- </ li >
167
- < li >
168
- < p > < code > sys</ code > = The system name, for example < code > linux</ code > , < code > windows</ code > , etc. < code > none</ code > is
169
- typically used for bare-metal without an OS.</ p >
170
- </ li >
171
- < li >
172
- < p > < code > abi</ code > = The ABI, for example < code > gnu</ code > , < code > android</ code > , < code > eabi</ code > , etc.</ p >
173
- </ li >
174
- </ ul >
175
- </ div >
176
- < div class ="openblock ">
177
- < div class ="content ">
178
- < div class ="paragraph ">
179
- < p > Some parameters may be omitted. Run < code > rustc --print target-list</ code > for a list of
180
- supported targets.</ p >
181
- </ div >
156
+ < p > Build for the given architecture. The default is the host
157
+ architecture. The general format of the triple is
158
+ < code > <arch><sub>-<vendor>-<sys>-<abi></ code > . Run < code > rustc --print target-list</ code > for a
159
+ list of supported targets.</ p >
182
160
< div class ="paragraph ">
183
161
< p > This may also be specified with the < code > build.target</ code >
184
162
< a href ="reference/config.html "> config value</ a > .</ p >
185
163
</ div >
186
- </ div >
187
- </ div >
188
164
</ dd >
189
165
< dt class ="hdlist1 "> < strong > --release</ strong > </ dt >
190
166
< dd >
191
- < p > Build artifacts in release mode, with optimizations . See the
167
+ < p > Build optimized artifacts with the < code > release</ code > profile . See the
192
168
< a href ="#cargo_build_profiles "> PROFILES</ a > section for details on how this affects profile selection.</ p >
193
169
</ dd >
194
170
</ dl >
@@ -356,11 +332,11 @@ <h2 id="cargo_build_profiles">PROFILES</h2>
356
332
< code > dev</ code > or < code > test</ code > profiles are used. If the < code > --release</ code > flag is given, then the
357
333
< code > release</ code > or < code > bench</ code > profiles are used.</ p >
358
334
</ div >
359
- < table class ="tableblock frame-all grid-all stretch ">
335
+ < table class ="tableblock frame-all grid-all fit-content ">
360
336
< colgroup >
361
- < col style =" width: 33.3333%; " >
362
- < col style =" width: 33.3333%; " >
363
- < col style =" width: 33.3334%; " >
337
+ < col >
338
+ < col >
339
+ < col >
364
340
</ colgroup >
365
341
< thead >
366
342
< tr >
@@ -376,7 +352,8 @@ <h2 id="cargo_build_profiles">PROFILES</h2>
376
352
< td class ="tableblock halign-left valign-top "> < p class ="tableblock "> < code > release</ code > </ p > </ td >
377
353
</ tr >
378
354
< tr >
379
- < td class ="tableblock halign-left valign-top "> < p class ="tableblock "> test, bench</ p > </ td >
355
+ < td class ="tableblock halign-left valign-top "> < p class ="tableblock "> test, bench, or any target< br >
356
+ in "test" or "bench" mode</ p > </ td >
380
357
< td class ="tableblock halign-left valign-top "> < p class ="tableblock "> < code > test</ code > </ p > </ td >
381
358
< td class ="tableblock halign-left valign-top "> < p class ="tableblock "> < code > bench</ code > </ p > </ td >
382
359
</ tr >
0 commit comments