Handle unicode natvis paths, simplify extension check to a single if.
This commit is contained in:
parent
cfc128cea4
commit
65b7908e10
1 changed files with 4 additions and 8 deletions
|
@ -484,14 +484,10 @@ impl<'a> Linker for MsvcLinker<'a> {
|
|||
match entry {
|
||||
Ok(entry) => {
|
||||
let path = entry.path();
|
||||
if let Some(ext) = path.extension() {
|
||||
if ext == OsStr::new("natvis") {
|
||||
if let Some(natvis_path_str) = path.to_str() {
|
||||
self.cmd.arg(&format!("/NATVIS:{}",natvis_path_str));
|
||||
} else {
|
||||
self.sess.warn(&format!("natvis path not unicode: {:?}", path));
|
||||
}
|
||||
}
|
||||
if path.extension() == Some("natvis".as_ref()) {
|
||||
let mut arg = OsString::from("/NATVIS:");
|
||||
arg.push(path);
|
||||
self.cmd.arg(arg);
|
||||
}
|
||||
},
|
||||
Err(err) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue