From af3d1e7e45bd079ebabca2d277357c8040dc1fe8 Mon Sep 17 00:00:00 2001 From: fedor Date: Tue, 24 Oct 2017 11:45:15 +0300 Subject: [PATCH] actually using ccache for compiler command --- src/lib.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9517eaa..87db8c4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1659,8 +1659,15 @@ impl Tool { /// command returned will already have the initial arguments and environment /// variables configured. pub fn to_command(&self) -> Command { - let mut cmd = Command::new(&self.path); - cmd.args(&self.cc_args); + let mut cmd = match self.cc_path { + Some(ref cc_path) => { + let mut cmd = Command::new(&cc_path); + cmd.arg(&self.path); + cmd.args(&self.cc_args); + cmd + }, + None => Command::new(&self.path) + }; cmd.args(&self.args); for &(ref k, ref v) in self.env.iter() { cmd.env(k, v);