Skip to content

Commit

Permalink
Fix location of atlmfc directory on MSVC 15+
Browse files Browse the repository at this point in the history
Old code was expecting {VC}\Tools\MSVC\{Version}\bin\x64\atlmfc, correct path is {VC}\Tools\MSVC\{Version}\atlmfc
  • Loading branch information
zdimension authored and ChrisDenton committed Nov 8, 2022
1 parent 66005c8 commit 25b95c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/windows_registry.rs
Expand Up @@ -431,7 +431,7 @@ mod impl_ {
target: &str,
instance_path: &PathBuf,
) -> Option<Tool> {
let (bin_path, host_dylib_path, lib_path, include_path) =
let (root_path, bin_path, host_dylib_path, lib_path, include_path) =
vs15plus_vc_paths(target, instance_path)?;
let tool_path = bin_path.join(tool);
if !tool_path.exists() {
Expand All @@ -444,7 +444,7 @@ mod impl_ {
tool.libs.push(lib_path);
tool.include.push(include_path);

if let Some((atl_lib_path, atl_include_path)) = atl_paths(target, &bin_path) {
if let Some((atl_lib_path, atl_include_path)) = atl_paths(target, &root_path) {
tool.libs.push(atl_lib_path);
tool.include.push(atl_include_path);
}
Expand All @@ -457,7 +457,7 @@ mod impl_ {
fn vs15plus_vc_paths(
target: &str,
instance_path: &PathBuf,
) -> Option<(PathBuf, PathBuf, PathBuf, PathBuf)> {
) -> Option<(PathBuf, PathBuf, PathBuf, PathBuf, PathBuf)> {
let version_path =
instance_path.join(r"VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt");
let mut version_file = File::open(version_path).ok()?;
Expand Down Expand Up @@ -490,7 +490,7 @@ mod impl_ {
.join(&host.to_lowercase());
let lib_path = path.join("lib").join(&target);
let include_path = path.join("include");
Some((bin_path, host_dylib_path, lib_path, include_path))
Some((path, bin_path, host_dylib_path, lib_path, include_path))
}

fn atl_paths(target: &str, path: &Path) -> Option<(PathBuf, PathBuf)> {
Expand Down

0 comments on commit 25b95c6

Please sign in to comment.