Use platform's path separator when writing cxxbridge.h

This commit is contained in:
David Tolnay 2020-02-24 22:00:11 -08:00
parent 25221c110b
commit b3d52389a8
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -463,7 +463,7 @@ fn try_generate_bridge(rust_source_file: &Path) -> Result<cc::Build> {
let mut build = paths::cc_build();
build.file(&bridge_path);
let ref cxxbridge_h = paths::include_dir()?.join("cxxbridge/cxxbridge.h");
let ref cxxbridge_h = paths::include_dir()?.join("cxxbridge").join("cxxbridge.h");
let _ = fs::create_dir_all(cxxbridge_h.parent().unwrap());
let _ = fs::remove_file(cxxbridge_h);
let _ = fs::write(cxxbridge_h, gen::include::HEADER);