From aa30d1d2516586841d2a353db064bfc2839343fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Thu, 23 Feb 2023 19:34:52 +0100 Subject: [PATCH] xtask: Default backend needs no argument Propagate features for check and build --- xtask/src/main.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 9ff0ae272e..f6d897529d 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -69,7 +69,7 @@ impl Backends { struct Cli { /// For which backend to build #[arg(value_enum, short, long)] - backend: Backends, + backend: Option, /// List of comma separated examples to include, all others are excluded /// @@ -254,7 +254,11 @@ fn main() -> anyhow::Result<()> { trace!("default logging level: {0}", cli.verbose); - let backend = cli.backend; + let backend = if let Some(backend) = cli.backend { + backend + } else { + Backends::default() + }; let example = cli.example; let exampleexclude = cli.exampleexclude; @@ -366,12 +370,14 @@ fn cargo_build( package: &Package, backend: Backends, ) -> anyhow::Result<()> { + let s = format!("{},{}", DEFAULT_FEATURES, backend.to_rtic_feature()); + let features: Option<&str> = Some(&s); command_parser( &CargoCommand::Build { cargoarg, package: package_filter(package), target: backend.to_target(), - features: None, + features, mode: BuildMode::Release, }, false, @@ -384,12 +390,14 @@ fn cargo_check( package: &Package, backend: Backends, ) -> anyhow::Result<()> { + let s = format!("{},{}", DEFAULT_FEATURES, backend.to_rtic_feature()); + let features: Option<&str> = Some(&s); command_parser( &CargoCommand::Check { cargoarg, package: package_filter(package), target: backend.to_target(), - features: None, + features, }, false, )?;