Skip to content

Commit

Permalink
fix compiler flags support of Cpp_original
Browse files Browse the repository at this point in the history
When using custom compiler with flags (say: clang++ --debug), "Command::new()" was unable to start process, giving an error message "No such file or directory".
  • Loading branch information
jonathanffon authored Jan 13, 2024
1 parent 551f583 commit 1b7953e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/interpreters/Cpp_original.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ impl Interpreter for Cpp_original {
let mut _file =
File::create(&self.main_file_path).expect("Failed to create file for rust-original");
write(&self.main_file_path, &self.code).expect("Unable to write to file for rust-original");
let output = Command::new(&self.compiler)
let output = Command::new(self.compiler.split_whitespace().next().unwrap())
.args(self.compiler.split_whitespace().skip(1))
.arg(&self.main_file_path)
.arg("-o")
.arg(&self.bin_path)
Expand Down

0 comments on commit 1b7953e

Please sign in to comment.