Skip to content

Commit 4a827f5

Browse files
committed
workcache: Don't assume gcc exists on all platforms
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.
1 parent 06edc6a commit 4a827f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libworkcache/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,9 @@ fn test() {
512512
prep.declare_input("file", pth.as_str().unwrap(), file_content);
513513
prep.exec(proc(_exe) {
514514
let out = make_path(~"foo.o");
515+
let compiler = if cfg!(windows) {"gcc"} else {"cc"};
515516
// FIXME (#9639): This needs to handle non-utf8 paths
516-
Process::status("gcc", [pth.as_str().unwrap().to_owned(),
517+
Process::status(compiler, [pth.as_str().unwrap().to_owned(),
517518
~"-o",
518519
out.as_str().unwrap().to_owned()]).unwrap();
519520

0 commit comments

Comments
 (0)