mirror of
https://github.com/esp-rs/espflash.git
synced 2026-04-10 00:25:11 +00:00
Allow for the build target to be specified via the command line as well
This commit is contained in:
@@ -156,9 +156,12 @@ fn build(
|
||||
cargo_config: &CargoConfig,
|
||||
chip: Option<Chip>,
|
||||
) -> Result<PathBuf> {
|
||||
let target = cargo_config
|
||||
.target()
|
||||
let target = build_options
|
||||
.target
|
||||
.as_deref()
|
||||
.or(cargo_config.target())
|
||||
.ok_or_else(|| NoTargetError::new(chip))?;
|
||||
|
||||
if let Some(chip) = chip {
|
||||
if !chip.supports_target(target) {
|
||||
return Err(Error::UnsupportedTarget(UnsupportedTargetError::new(target, chip)).into());
|
||||
|
||||
@@ -23,6 +23,9 @@ pub struct BuildArgs {
|
||||
/// Image format to flash (bootloader/direct-boot)
|
||||
#[clap(long)]
|
||||
pub format: Option<String>,
|
||||
/// Target to build for
|
||||
#[clap(long)]
|
||||
pub target: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
|
||||
Reference in New Issue
Block a user