@@ -91,26 +91,32 @@ <h3 id="cargo_build_target_selection">Target Selection</h3>
9191</ dd >
9292< dt class ="hdlist1 "> < strong > --tests</ strong > </ dt >
9393< 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 >
98101</ dd >
99102< dt class ="hdlist1 "> < strong > --bench</ strong > < em > NAME</ em > …​</ dt >
100103< dd >
101104< p > Build the specified benchmark. This flag may be specified multiple times.</ p >
102105</ dd >
103106< dt class ="hdlist1 "> < strong > --benches</ strong > </ dt >
104107< 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 >
110115</ dd >
111116< dt class ="hdlist1 "> < strong > --all-targets</ strong > </ dt >
112117< 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 >
114120</ dd >
115121</ dl >
116122</ div >
@@ -147,48 +153,18 @@ <h3 id="cargo_build_compilation_options">Compilation Options</h3>
147153< dl >
148154< dt class ="hdlist1 "> < strong > --target</ strong > < em > TRIPLE</ em > </ dt >
149155< 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 >
182160< div class ="paragraph ">
183161< p > This may also be specified with the < code > build.target</ code >
184162< a href ="reference/config.html "> config value</ a > .</ p >
185163</ div >
186- </ div >
187- </ div >
188164</ dd >
189165< dt class ="hdlist1 "> < strong > --release</ strong > </ dt >
190166< 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
192168< a href ="#cargo_build_profiles "> PROFILES</ a > section for details on how this affects profile selection.</ p >
193169</ dd >
194170</ dl >
@@ -356,11 +332,11 @@ <h2 id="cargo_build_profiles">PROFILES</h2>
356332< code > dev</ code > or < code > test</ code > profiles are used. If the < code > --release</ code > flag is given, then the
357333< code > release</ code > or < code > bench</ code > profiles are used.</ p >
358334</ div >
359- < table class ="tableblock frame-all grid-all stretch ">
335+ < table class ="tableblock frame-all grid-all fit-content ">
360336< 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 >
364340</ colgroup >
365341< thead >
366342< tr >
@@ -376,7 +352,8 @@ <h2 id="cargo_build_profiles">PROFILES</h2>
376352< td class ="tableblock halign-left valign-top "> < p class ="tableblock "> < code > release</ code > </ p > </ td >
377353</ tr >
378354< 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 >
380357< td class ="tableblock halign-left valign-top "> < p class ="tableblock "> < code > test</ code > </ p > </ td >
381358< td class ="tableblock halign-left valign-top "> < p class ="tableblock "> < code > bench</ code > </ p > </ td >
382359</ tr >
0 commit comments