Actually use the temp dir for temporary compiled objects.

If the cbindgen_output is an absolute path, then join() will just return it.

Really fixes #499.
This commit is contained in:
Emilio Cobos Álvarez 2020-04-04 23:45:18 +02:00
parent 4a38a48937
commit a519f1bda4

View File

@ -74,7 +74,10 @@ fn compile(
Language::C => env::var("CC").unwrap_or_else(|_| "gcc".to_owned()), Language::C => env::var("CC").unwrap_or_else(|_| "gcc".to_owned()),
}; };
let mut object = tmp_dir.join(cbindgen_output); let file_name = cbindgen_output
.file_name()
.expect("cbindgen output should be a file");
let mut object = tmp_dir.join(file_name);
object.set_extension("o"); object.set_extension("o");
let mut command = Command::new(cc); let mut command = Command::new(cc);