diff options
author | Daniel Mueller <deso@posteo.net> | 2019-08-15 08:12:14 -0700 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2019-08-15 08:12:14 -0700 |
commit | b766d584b36b78c96e9ef60ec927214c74ede4ab (patch) | |
tree | f4032b79b7a51183947e9ccd6e363fe5946dd1d3 /cc/src/windows_registry.rs | |
parent | 155f9b7e7f36975240ef93f3daf983b228592a11 (diff) | |
download | nitrocli-b766d584b36b78c96e9ef60ec927214c74ede4ab.tar.gz nitrocli-b766d584b36b78c96e9ef60ec927214c74ede4ab.tar.bz2 |
Update cc crate to 1.0.40
This change updates the cc crate to version 1.0.40.
Import subrepo cc/:cc at 6ad3da7558ec3ccb4dc9c2ed1487fc139469d41e
Diffstat (limited to 'cc/src/windows_registry.rs')
-rw-r--r-- | cc/src/windows_registry.rs | 32 |
1 files changed, 18 insertions, 14 deletions
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<Iterator<Item=PathBuf>> { + fn vs16_instances() -> Box<Iterator<Item = PathBuf>> { 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<Tool> { - 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<Tool> { @@ -727,7 +729,9 @@ mod impl_ { // see http://stackoverflow.com/questions/328017/path-to-msbuild pub fn find_msbuild(target: &str) -> Option<Tool> { // 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) |