Skip to content

Commit 439e184

Browse files
committed
Auto merge of #30516 - retep998:non-universal-crt, r=alexcrichton
Checks for a `10.` prefix on the subfolder because that is what vcvars does. r? @alexcrichton
2 parents 5d4efcb + e77ab57 commit 439e184

File tree

1 file changed

+9
-2
lines changed
  • src/librustc_trans/back/msvc

1 file changed

+9
-2
lines changed

Diff for: src/librustc_trans/back/msvc/mod.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,15 @@ pub fn link_exe_cmd(sess: &Session) -> Command {
152152
}).and_then(|root| {
153153
fs::read_dir(Path::new(&root).join("Lib")).ok()
154154
}).and_then(|readdir| {
155-
let mut dirs: Vec<_> = readdir.filter_map(|dir| dir.ok())
156-
.map(|dir| dir.path()).collect();
155+
let mut dirs: Vec<_> = readdir.filter_map(|dir| {
156+
dir.ok()
157+
}).map(|dir| {
158+
dir.path()
159+
}).filter(|dir| {
160+
dir.components().last().and_then(|c| {
161+
c.as_os_str().to_str()
162+
}).map(|c| c.starts_with("10.")).unwrap_or(false)
163+
}).collect();
157164
dirs.sort();
158165
dirs.pop()
159166
})

0 commit comments

Comments
 (0)