aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/cargo_commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/src/cargo_commands.rs')
-rw-r--r--xtask/src/cargo_commands.rs50
1 files changed, 28 insertions, 22 deletions
diff --git a/xtask/src/cargo_commands.rs b/xtask/src/cargo_commands.rs
index 42895d8..2e30997 100644
--- a/xtask/src/cargo_commands.rs
+++ b/xtask/src/cargo_commands.rs
@@ -312,30 +312,36 @@ pub fn qemu_run_examples<'c>(
let target = backend.to_target();
let features = Some(target.and_features(backend.to_rtic_feature()));
- let build = examples_iter(examples).map(|example| {
- let cmd_build = CargoCommand::ExampleBuild {
- // We need to be in the correct
- cargoarg: &None,
- example,
- target,
- features: features.clone(),
- mode: BuildMode::Release,
- };
- (globals, cmd_build, overwrite)
- });
+ examples_iter(examples)
+ .flat_map(|example| {
+ let cmd_build = CargoCommand::ExampleBuild {
+ cargoarg: &None,
+ example,
+ target,
+ features: features.clone(),
+ mode: BuildMode::Release,
+ };
- let run = examples_iter(examples).map(|example| {
- let cmd_qemu = CargoCommand::Qemu {
- cargoarg,
- example,
- target,
- features: features.clone(),
- mode: BuildMode::Release,
- };
- (globals, cmd_qemu, overwrite)
- });
+ let cmd_qemu = CargoCommand::Qemu {
+ cargoarg,
+ example,
+ target,
+ features: features.clone(),
+ mode: BuildMode::Release,
+ };
+
+ #[cfg(not(feature = "rayon"))]
+ {
+ [cmd_build, cmd_qemu].into_iter()
+ }
- build.chain(run).run_and_coalesce()
+ #[cfg(feature = "rayon")]
+ {
+ [cmd_build, cmd_qemu].into_par_iter()
+ }
+ })
+ .map(|cmd| (globals, cmd, overwrite))
+ .run_and_coalesce()
}
/// Check the binary sizes of examples