Skip to content

Commit

Permalink
Add Cc::output method
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed May 30, 2024
1 parent 91c0823 commit 2ecb08a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/tools/run-make-support/src/cc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ impl Cc {
self
}

/// Specify path of the output binary.
pub fn output<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
self.cmd.arg("-o");
self.cmd.arg(path.as_ref());
self
}

/// Get the [`Output`][::std::process::Output] of the finished process.
pub fn command_output(&mut self) -> ::std::process::Output {
self.cmd.output().expect("failed to get output of finished process")
Expand Down

0 comments on commit 2ecb08a

Please sign in to comment.