From 1b7953e9085447e608f28ebc4d3f6c3a111d17a7 Mon Sep 17 00:00:00 2001 From: galago <10259652+jonathanffon@users.noreply.github.com> Date: Sat, 13 Jan 2024 12:51:33 +0800 Subject: [PATCH] fix compiler flags support of Cpp_original 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". --- src/interpreters/Cpp_original.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/interpreters/Cpp_original.rs b/src/interpreters/Cpp_original.rs index 96ba209..156ac87 100644 --- a/src/interpreters/Cpp_original.rs +++ b/src/interpreters/Cpp_original.rs @@ -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)