Build each grammar in it's own src dir

Windows places temporary files in the current dir, so compiling in
parallel caused conflicts.
pull/448/head
Blaž Hrastnik 3 years ago
parent a7fa5621ce
commit e6bf6a8f28

@ -55,14 +55,13 @@ fn build_library(src_path: &Path, language: &str) -> Result<()> {
if !recompile { if !recompile {
return Ok(()); return Ok(());
} }
let build_dir = std::env::var("OUT_DIR").unwrap();
let mut config = cc::Build::new(); let mut config = cc::Build::new();
config.cpp(true).opt_level(2).cargo_metadata(false); config.cpp(true).opt_level(2).cargo_metadata(false);
// .target(BUILD_TARGET) // .target(BUILD_TARGET)
// .host(BUILD_TARGET); // .host(BUILD_TARGET);
let compiler = config.get_compiler(); let compiler = config.get_compiler();
let mut command = Command::new(compiler.path()); let mut command = Command::new(compiler.path());
command.current_dir(build_dir); command.current_dir(src_path);
for (key, value) in compiler.env() { for (key, value) in compiler.env() {
command.env(key, value); command.env(key, value);
} }

Loading…
Cancel
Save