From b66803a4e6a42913d0154e433065c5e478f8c1c1 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Thu, 15 Aug 2019 08:12:14 -0700 Subject: Update cc crate to 1.0.40 This change updates the cc crate to version 1.0.40. Import subrepo cc/:cc at 6ad3da7558ec3ccb4dc9c2ed1487fc139469d41e --- cc/src/windows_registry.rs | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'cc/src/windows_registry.rs') diff --git a/cc/src/windows_registry.rs b/cc/src/windows_registry.rs index af812a7..ee39339 100644 --- a/cc/src/windows_registry.rs +++ b/cc/src/windows_registry.rs @@ -180,8 +180,8 @@ mod impl_ { use std::ffi::OsString; use std::fs::File; use std::io::Read; - use std::mem; use std::iter; + use std::mem; use std::path::{Path, PathBuf}; use Tool; @@ -218,7 +218,7 @@ mod impl_ { } } - fn vs16_instances() -> Box> { + fn vs16_instances() -> Box> { let instances = if let Some(instances) = vs15_instances() { instances } else { @@ -236,17 +236,19 @@ mod impl_ { } fn find_tool_in_vs16_path(tool: &str, target: &str) -> Option { - vs16_instances().filter_map(|path| { - let path = path.join(tool); - if !path.is_file() { - return None; - } - let mut tool = Tool::new(path); - if target.contains("x86_64") { - tool.env.push(("Platform".into(), "X64".into())); - } - Some(tool) - }).next() + vs16_instances() + .filter_map(|path| { + let path = path.join(tool); + if !path.is_file() { + return None; + } + let mut tool = Tool::new(path); + if target.contains("x86_64") { + tool.env.push(("Platform".into(), "X64".into())); + } + Some(tool) + }) + .next() } fn find_msbuild_vs16(target: &str) -> Option { @@ -727,7 +729,9 @@ mod impl_ { // see http://stackoverflow.com/questions/328017/path-to-msbuild pub fn find_msbuild(target: &str) -> Option { // VS 15 (2017) changed how to locate msbuild - if let Some(r) = find_msbuild_vs15(target) { + if let Some(r) = find_msbuild_vs16(target) { + return Some(r); + } else if let Some(r) = find_msbuild_vs15(target) { return Some(r); } else { find_old_msbuild(target) -- cgit v1.2.3