Skip to content

Commit

Permalink
Fix Universal CRT detection on weird setups
Browse files Browse the repository at this point in the history
Checks for a `10.` prefix on the subfolder

Signed-off-by: Peter Atashian <[email protected]>
  • Loading branch information
retep998 committed Dec 22, 2015
1 parent 2343a92 commit e77ab57
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/librustc_trans/back/msvc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,15 @@ pub fn link_exe_cmd(sess: &Session) -> Command {
}).and_then(|root| {
fs::read_dir(Path::new(&root).join("Lib")).ok()
}).and_then(|readdir| {
let mut dirs: Vec<_> = readdir.filter_map(|dir| dir.ok())
.map(|dir| dir.path()).collect();
let mut dirs: Vec<_> = readdir.filter_map(|dir| {
dir.ok()
}).map(|dir| {
dir.path()
}).filter(|dir| {
dir.components().last().and_then(|c| {
c.as_os_str().to_str()
}).map(|c| c.starts_with("10.")).unwrap_or(false)
}).collect();
dirs.sort();
dirs.pop()
})
Expand Down

0 comments on commit e77ab57

Please sign in to comment.