Skip to content

Commit

Permalink
Support --target-dir and --config (fix AndrewGaspar#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedbrown committed Dec 5, 2022
1 parent 7e0b618 commit d625771
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ pub struct Args {
/// Build for the target triple
#[arg(long, value_name = "TRIPLE")]
pub target: Option<String>,
/// Directory for all generated artifacts
#[arg(long, value_name = "DIRECTORY")]
pub target_dir: Option<String>,
/// Override a configuration value
#[arg(long, value_name = "KEY=VAL")]
pub config: Vec<String>,
/// Path to the manifest to execute
#[arg(long)]
pub manifest_path: Option<std::path::PathBuf>,
Expand Down
6 changes: 6 additions & 0 deletions src/cargo_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ pub fn add_cargo_options(command: &mut Command, args: &crate::Args) {
if let Some(ref val) = args.target {
command.arg("--target").arg(val);
}
if let Some(ref val) = args.target_dir {
command.arg("--target-dir").arg(val);
}
for keyval in args.config.iter() {
command.arg("--config").arg(keyval);
}
if let Some(ref val) = args.manifest_path {
command.arg("--manifest-path").arg(val);
}
Expand Down

0 comments on commit d625771

Please sign in to comment.