]> git.lizzy.rs Git - rust.git/commitdiff
workcache: Don't assume gcc exists on all platforms
authorAlex Crichton <alex@alexcrichton.com>
Wed, 16 Apr 2014 01:25:38 +0000 (18:25 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 16 Apr 2014 02:47:03 +0000 (19:47 -0700)
FreeBSD has recently moved to clang by default, and no longer ship gcc. Instead
use "cc" on unix platforms (the default compiler) and "gcc" on windows.

src/libworkcache/lib.rs

index 623488ac6129d148e9509dc2925b8af998881e20..7dd2d945c26c736d2ca06fd349b2b33ee927ccdf 100644 (file)
@@ -512,8 +512,9 @@ fn make_path(filename: ~str) -> Path {
         prep.declare_input("file", pth.as_str().unwrap(), file_content);
         prep.exec(proc(_exe) {
             let out = make_path(~"foo.o");
+            let compiler = if cfg!(windows) {"gcc"} else {"cc"};
             // FIXME (#9639): This needs to handle non-utf8 paths
-            Process::status("gcc", [pth.as_str().unwrap().to_owned(),
+            Process::status(compiler, [pth.as_str().unwrap().to_owned(),
                                     ~"-o",
                                     out.as_str().unwrap().to_owned()]).unwrap();