diff --git a/app/demo-stm32h7-nucleo/app-h753.toml b/app/demo-stm32h7-nucleo/app-h753.toml index 0909520e4..1ce41b187 100644 --- a/app/demo-stm32h7-nucleo/app-h753.toml +++ b/app/demo-stm32h7-nucleo/app-h753.toml @@ -207,6 +207,8 @@ extern-regions = [ "sram2", "sram3", "sram4" ] [tasks.fmc_demo] name = "drv-stm32h7-fmc-demo-server" +# drv/stmh32h7-fmc-demo-server includes the `h743` feature in its defaults +no-default-features = true features = ["h753"] priority = 4 start = true diff --git a/build/xtask/src/config.rs b/build/xtask/src/config.rs index aa6c286a3..00978a42c 100644 --- a/build/xtask/src/config.rs +++ b/build/xtask/src/config.rs @@ -222,14 +222,14 @@ impl Config { &self, verbose: bool, crate_name: &str, + no_default_features: bool, features: &[String], sysroot: Option<&'a Path>, ) -> BuildConfig<'a> { - let mut args = vec![ - "--no-default-features".to_string(), - "--target".to_string(), - self.target.to_string(), - ]; + let mut args = vec!["--target".to_string(), self.target.to_string()]; + if no_default_features { + args.push("--no-default-features".to_string()); + } if verbose { args.push("-v".to_string()); } @@ -305,6 +305,7 @@ impl Config { let mut out = self.common_build_config( verbose, &self.kernel.name, + self.kernel.no_default_features, &self.kernel.features, sysroot, ); @@ -327,6 +328,7 @@ impl Config { let mut out = self.common_build_config( verbose, &task_toml.name, + task_toml.no_default_features, &task_toml.features, sysroot, ); @@ -626,6 +628,8 @@ pub struct Kernel { pub stacksize: Option, #[serde(default)] pub features: Vec, + #[serde(default)] + pub no_default_features: bool, } fn default_name() -> String { diff --git a/lib/toml-task/src/lib.rs b/lib/toml-task/src/lib.rs index aabc67462..bc7e360d1 100644 --- a/lib/toml-task/src/lib.rs +++ b/lib/toml-task/src/lib.rs @@ -58,6 +58,8 @@ pub struct Task { pub sections: IndexMap, #[serde(default)] pub max_sizes: IndexMap, + #[serde(default)] + pub no_default_features: bool, } impl Task {