Skip to content

Commit

Permalink
code review update
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDenton committed Dec 29, 2024
1 parent f48efdd commit 75cb084
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/windows/find_tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ mod impl_ {
return None;
}
let mut tool = Tool::with_family(path, MSVC_FAMILY);
if target == TargetArch::X86 {
if target == TargetArch::X64 {
tool.env.push(("Platform".into(), "X64".into()));
}
if matches!(target, TargetArch::Arm64 | TargetArch::Arm64ec) {
Expand Down Expand Up @@ -704,7 +704,7 @@ mod impl_ {
}
_ => return None,
};
let target_dir = lib_subdir(target_arch)?;
let target_dir = target_arch.as_vs_arch();
// The directory layout here is MSVC/bin/Host$host/$target/
let path = instance_path.join(r"VC\Tools\MSVC").join(version);
// We use the first available host architecture that can build for the target
Expand Down Expand Up @@ -788,7 +788,7 @@ mod impl_ {

fn atl_paths(target: TargetArch, path: &Path) -> Option<(PathBuf, PathBuf)> {
let atl_path = path.join("atlmfc");
let sub = lib_subdir(target)?;
let sub = target.as_vs_arch();
if atl_path.exists() {
Some((atl_path.join("lib").join(sub), atl_path.join("include")))
} else {
Expand All @@ -810,7 +810,7 @@ mod impl_ {
}

fn add_sdks(tool: &mut MsvcTool, target: TargetArch, env_getter: &dyn EnvGetter) -> Option<()> {
let sub = lib_subdir(target)?;
let sub = target.as_vs_arch();
let (ucrt, ucrt_version) = get_ucrt_dir()?;

let host = match host_arch() {
Expand Down Expand Up @@ -1017,10 +1017,6 @@ mod impl_ {
}
}

fn lib_subdir(target: TargetArch) -> Option<&'static str> {
Some(target.as_vs_arch())
}

// MSVC's x86 libraries are not in a subfolder
fn vc_lib_subdir(target: TargetArch) -> &'static str {
match target {
Expand Down

0 comments on commit 75cb084

Please sign in to comment.